home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / doc / wish.tex < prev    next >
LaTeX Document  |  1980-02-12  |  18.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 20 77 69 73 68 2e | 74 65 78 0a 5c 63 20 47 |\c wish.|tex.\c G|
|00000010| 65 6f 66 66 72 65 79 20 | 46 75 72 6e 69 73 68 0a |eoffrey |Furnish.|
|00000020| 5c 63 20 39 20 4d 61 79 | 20 31 39 39 34 0a 0a 5c |\c 9 May| 1994..\|
|00000030| 6e 6f 64 65 20 45 78 74 | 65 6e 64 65 64 20 57 49 |node Ext|ended WI|
|00000040| 53 48 2c 20 41 50 49 2c | 20 44 72 69 76 65 72 73 |SH, API,| Drivers|
|00000050| 2c 20 54 6f 70 0a 5c 63 | 68 61 70 74 65 72 7b 42 |, Top.\c|hapter{B|
|00000060| 75 69 6c 64 69 6e 67 20 | 61 6e 20 45 78 74 65 6e |uilding |an Exten|
|00000070| 64 65 64 20 57 49 53 48 | 7d 0a 5c 63 69 6e 64 65 |ded WISH|}.\cinde|
|00000080| 78 7b 77 69 73 68 7d 0a | 5c 63 69 6e 64 65 78 7b |x{wish}.|\cindex{|
|00000090| 54 63 6c 20 45 78 74 65 | 6e 73 69 6f 6e 73 7d 0a |Tcl Exte|nsions}.|
|000000a0| 0a 42 65 67 69 6e 6e 69 | 6e 67 20 77 69 74 68 20 |.Beginni|ng with |
|000000b0| 50 4c 70 6c 6f 74 20 35 | 2e 30 2c 20 61 20 6e 65 |PLplot 5|.0, a ne|
|000000c0| 77 20 61 6e 64 20 70 6f | 77 65 72 66 75 6c 20 70 |w and po|werful p|
|000000d0| 61 72 61 64 69 67 6d 20 | 66 6f 72 20 69 6e 74 65 |aradigm |for inte|
|000000e0| 72 61 63 74 69 6f 6e 0a | 77 69 74 68 20 50 4c 70 |raction.|with PLp|
|000000f0| 6c 6f 74 20 69 73 20 69 | 6e 74 72 6f 64 75 63 65 |lot is i|ntroduce|
|00000100| 64 2e 20 20 54 68 69 73 | 20 6e 65 77 20 70 61 72 |d. This| new par|
|00000110| 61 64 69 67 6d 20 63 6f | 6e 73 69 73 74 73 20 6f |adigm co|nsists o|
|00000120| 66 20 61 6e 0a 69 6e 74 | 65 67 72 61 74 69 6f 6e |f an.int|egration|
|00000130| 20 6f 66 20 50 4c 70 6c | 6f 74 20 77 69 74 68 20 | of PLpl|ot with |
|00000140| 61 20 70 6f 77 65 72 66 | 75 6c 20 73 63 72 69 70 |a powerf|ul scrip|
|00000150| 74 69 6e 67 20 6c 61 6e | 67 75 61 67 65 20 28 54 |ting lan|guage (T|
|00000160| 63 6c 29 2c 20 61 6e 64 | 0a 65 78 74 65 6e 73 69 |cl), and|.extensi|
|00000170| 6f 6e 73 20 74 6f 20 74 | 68 61 74 20 6c 61 6e 67 |ons to t|hat lang|
|00000180| 75 61 67 65 20 74 6f 20 | 73 75 70 70 6f 72 74 20 |uage to |support |
|00000190| 58 20 57 69 6e 64 6f 77 | 73 20 69 6e 74 65 72 66 |X Window|s interf|
|000001a0| 61 63 65 20 64 65 76 65 | 6c 6f 70 6d 65 6e 74 0a |ace deve|lopment.|
|000001b0| 28 54 6b 29 20 61 6e 64 | 20 6f 62 6a 65 63 74 20 |(Tk) and| object |
|000001c0| 6f 72 69 65 6e 74 65 64 | 20 70 72 6f 67 72 61 6d |oriented| program|
|000001d0| 6d 69 6e 67 20 28 5b 69 | 6e 63 72 20 54 63 6c 5d |ming ([i|ncr Tcl]|
|000001e0| 29 2e 20 20 54 61 6b 65 | 6e 20 74 6f 67 65 74 68 |). Take|n togeth|
|000001f0| 65 72 2c 0a 74 68 65 73 | 65 20 66 6f 75 72 20 73 |er,.thes|e four s|
|00000200| 6f 66 74 77 61 72 65 20 | 73 79 73 74 65 6d 73 20 |oftware |systems |
|00000210| 28 54 63 6c 2f 54 6b 2f | 69 74 63 6c 2f 50 4c 70 |(Tcl/Tk/|itcl/PLp|
|00000220| 6c 6f 74 29 20 63 6f 6d | 70 72 69 73 65 20 61 20 |lot) com|prise a |
|00000230| 70 6f 77 65 72 66 75 6c | 0a 65 6e 76 69 72 6f 6e |powerful|.environ|
|00000240| 6d 65 6e 74 20 66 6f 72 | 20 74 68 65 20 72 61 70 |ment for| the rap|
|00000250| 69 64 20 70 72 6f 74 6f | 74 79 70 69 6e 67 20 61 |id proto|typing a|
|00000260| 6e 64 20 64 65 76 65 6c | 6f 70 6d 65 6e 74 20 6f |nd devel|opment o|
|00000270| 66 0a 73 6f 70 68 69 73 | 74 69 63 61 74 65 64 2c |f.sophis|ticated,|
|00000280| 20 66 6c 65 78 69 62 6c | 65 2c 20 58 20 57 69 6e | flexibl|e, X Win|
|00000290| 64 6f 77 73 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |dows app|lication|
|000002a0| 73 20 77 69 74 68 20 61 | 63 63 65 73 73 20 74 6f |s with a|ccess to|
|000002b0| 20 74 68 65 0a 50 4c 70 | 6c 6f 74 20 41 50 49 2e | the.PLp|lot API.|
|000002c0| 20 20 59 65 74 20 74 68 | 61 74 20 69 73 20 6f 6e | Yet th|at is on|
|000002d0| 6c 79 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |ly the b|eginning|
|000002e0| 2d 2d 54 63 6c 20 77 61 | 73 20 62 6f 72 6e 20 74 |--Tcl wa|s born t|
|000002f0| 6f 20 62 65 0a 65 78 74 | 65 6e 64 65 64 2e 20 20 |o be.ext|ended. |
|00000300| 54 68 65 20 74 72 75 65 | 20 70 6f 77 65 72 20 6f |The true| power o|
|00000310| 66 20 74 68 69 73 20 70 | 61 72 61 64 69 67 6d 20 |f this p|aradigm |
|00000320| 69 73 20 61 63 68 69 65 | 76 65 64 20 77 68 65 6e |is achie|ved when|
|00000330| 20 79 6f 75 20 61 64 64 | 0a 79 6f 75 72 20 6f 77 | you add|.your ow|
|00000340| 6e 2c 20 70 6f 77 65 72 | 66 75 6c 2c 20 61 70 70 |n, power|ful, app|
|00000350| 6c 69 63 61 74 69 6f 6e | 20 73 70 65 63 69 66 69 |lication| specifi|
|00000360| 63 20 65 78 74 65 6e 73 | 69 6f 6e 73 20 74 6f 20 |c extens|ions to |
|00000370| 74 68 65 20 61 62 6f 76 | 65 0a 71 75 61 72 74 65 |the abov|e.quarte|
|00000380| 74 2c 20 74 68 75 73 20 | 63 72 65 61 74 69 6e 67 |t, thus |creating|
|00000390| 20 61 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 | an envi|ronment |
|000003a0| 66 6f 72 20 74 68 65 20 | 64 65 76 65 6c 6f 70 6d |for the |developm|
|000003b0| 65 6e 74 20 6f 66 20 77 | 68 6f 6c 6c 79 0a 6e 65 |ent of w|holly.ne|
|000003c0| 77 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 73 20 77 |w applic|ations w|
|000003d0| 69 74 68 20 6f 6e 6c 79 | 20 61 20 66 65 77 20 6b |ith only| a few k|
|000003e0| 65 79 73 74 72 6f 6b 65 | 73 20 6f 66 20 73 68 65 |eystroke|s of she|
|000003f0| 6c 6c 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 2e |ll progr|amming .|
|00000400| 2e 2e 0a 0a 5c 62 65 67 | 69 6e 7b 6d 65 6e 75 7d |....\beg|in{menu}|
|00000410| 0a 2a 20 54 63 6c 20 49 | 6e 74 72 6f 3a 3a 09 09 |.* Tcl I|ntro::..|
|00000420| 54 68 65 20 54 6f 6f 6c | 20 43 6f 6d 6d 61 6e 64 |The Tool| Command|
|00000430| 20 4c 61 6e 67 75 61 67 | 65 0a 2a 20 54 6b 20 49 | Languag|e.* Tk I|
|00000440| 6e 74 72 6f 3a 3a 09 09 | 55 73 65 72 20 49 6e 74 |ntro::..|User Int|
|00000450| 65 72 66 61 63 65 20 50 | 72 6f 67 72 61 6d 6d 69 |erface P|rogrammi|
|00000460| 6e 67 20 77 69 74 68 20 | 53 63 72 69 70 74 73 0a |ng with |Scripts.|
|00000470| 2a 20 49 74 63 6c 20 49 | 6e 74 72 6f 3a 3a 09 09 |* Itcl I|ntro::..|
|00000480| 41 6c 6c 20 74 68 65 20 | 61 62 6f 76 65 20 77 69 |All the |above wi|
|00000490| 74 68 20 4f 62 6a 65 63 | 74 20 4f 72 69 65 6e 74 |th Objec|t Orient|
|000004a0| 61 74 69 6f 6e 0a 2a 20 | 50 4c 70 6c 6f 74 20 45 |ation.* |PLplot E|
|000004b0| 78 74 65 6e 73 69 6f 6e | 73 3a 3a 09 55 73 69 6e |xtension|s::.Usin|
|000004c0| 67 20 50 4c 70 6c 6f 74 | 20 66 72 6f 6d 20 54 63 |g PLplot| from Tc|
|000004d0| 6c 2e 0a 2a 20 43 75 73 | 74 6f 6d 20 45 78 74 65 |l..* Cus|tom Exte|
|000004e0| 6e 73 69 6f 6e 73 3a 3a | 09 4d 61 6b 69 6e 67 20 |nsions::|.Making |
|000004f0| 79 6f 75 72 20 6f 77 6e | 20 57 49 53 48 0a 5c 65 |your own| WISH.\e|
|00000500| 6e 64 7b 6d 65 6e 75 7d | 0a 0a 5c 6e 6f 64 65 20 |nd{menu}|..\node |
|00000510| 54 63 6c 20 49 6e 74 72 | 6f 2c 20 54 6b 20 49 6e |Tcl Intr|o, Tk In|
|00000520| 74 72 6f 2c 20 45 78 74 | 65 6e 64 65 64 20 57 49 |tro, Ext|ended WI|
|00000530| 53 48 2c 20 45 78 74 65 | 6e 64 65 64 20 57 49 53 |SH, Exte|nded WIS|
|00000540| 48 0a 5c 73 65 63 74 69 | 6f 6e 7b 49 6e 74 72 6f |H.\secti|on{Intro|
|00000550| 64 75 63 74 69 6f 6e 20 | 74 6f 20 54 63 6c 7d 0a |duction |to Tcl}.|
|00000560| 5c 63 69 6e 64 65 78 7b | 54 63 6c 7d 0a 5c 63 69 |\cindex{|Tcl}.\ci|
|00000570| 6e 64 65 78 7b 57 68 61 | 74 20 69 73 20 54 63 6c |ndex{Wha|t is Tcl|
|00000580| 7d 0a 5c 63 69 6e 64 65 | 78 7b 50 72 6f 67 72 61 |}.\cinde|x{Progra|
|00000590| 6d 6d 69 6e 67 20 77 69 | 74 68 20 54 63 6c 7d 0a |mming wi|th Tcl}.|
|000005a0| 0a 54 68 65 20 54 6f 6f | 6c 20 43 6f 6d 6d 61 6e |.The Too|l Comman|
|000005b0| 64 20 4c 61 6e 67 75 61 | 67 65 2c 20 6f 72 20 6a |d Langua|ge, or j|
|000005c0| 75 73 74 20 54 63 6c 20 | 28 70 72 6f 6e 6f 75 6e |ust Tcl |(pronoun|
|000005d0| 63 65 64 20 60 60 74 69 | 63 6b 6c 65 27 27 29 20 |ced ``ti|ckle'') |
|000005e0| 69 73 20 61 6e 0a 65 6d | 62 65 64 61 62 6c 65 20 |is an.em|bedable |
|000005f0| 73 63 72 69 70 74 20 6c | 61 6e 67 75 61 67 65 20 |script l|anguage |
|00000600| 77 68 69 63 68 20 63 61 | 6e 20 62 65 20 75 73 65 |which ca|n be use|
|00000610| 64 20 74 6f 20 63 6f 6e | 74 72 6f 6c 20 61 20 77 |d to con|trol a w|
|00000620| 69 64 65 20 76 61 72 69 | 65 74 79 0a 6f 66 20 61 |ide vari|ety.of a|
|00000630| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 20 20 44 65 |pplicati|ons. De|
|00000640| 73 69 67 6e 65 64 20 62 | 79 20 4a 6f 68 6e 20 4f |signed b|y John O|
|00000650| 75 73 74 65 72 68 6f 75 | 74 20 6f 66 20 55 43 20 |usterhou|t of UC |
|00000660| 42 65 72 6b 65 6c 65 79 | 2c 20 54 63 6c 20 69 73 |Berkeley|, Tcl is|
|00000670| 0a 66 72 65 65 6c 79 20 | 61 76 61 69 6c 61 62 6c |.freely |availabl|
|00000680| 65 20 75 6e 64 65 72 20 | 74 68 65 20 73 74 61 6e |e under |the stan|
|00000690| 64 61 72 64 20 42 65 72 | 6b 65 6c 65 79 20 63 6f |dard Ber|keley co|
|000006a0| 70 79 72 69 67 68 74 2e | 20 20 54 63 6c 20 61 6e |pyright.| Tcl an|
|000006b0| 64 20 54 6b 0a 28 64 65 | 73 63 72 69 62 65 64 20 |d Tk.(de|scribed |
|000006c0| 62 65 6c 6f 77 29 20 61 | 72 65 20 65 78 74 65 6e |below) a|re exten|
|000006d0| 73 69 76 65 6c 79 20 64 | 6f 63 75 6d 65 6e 74 65 |sively d|ocumente|
|000006e0| 64 20 69 6e 20 61 20 6e | 65 77 20 62 6f 6f 6b 20 |d in a n|ew book |
|000006f0| 70 75 62 6c 69 73 68 65 | 64 20 62 79 0a 41 64 64 |publishe|d by.Add|
|00000700| 69 73 6f 6e 20 57 65 73 | 6c 65 79 2c 20 65 6e 74 |ison Wes|ley, ent|
|00000710| 69 74 6c 65 64 20 60 60 | 54 63 6c 20 61 6e 64 20 |itled ``|Tcl and |
|00000720| 74 68 65 20 54 6b 20 74 | 6f 6f 6c 6b 69 74 27 27 |the Tk t|oolkit''|
|00000730| 20 62 79 20 4a 6f 68 6e | 0a 4f 75 73 74 65 72 68 | by John|.Ousterh|
|00000740| 6f 75 74 2e 20 20 54 68 | 69 73 20 62 6f 6f 6b 20 |out. Th|is book |
|00000750| 69 73 20 61 20 6d 75 73 | 74 20 68 61 76 65 20 66 |is a mus|t have f|
|00000760| 6f 72 20 74 68 6f 73 65 | 20 69 6e 74 65 72 65 73 |or those| interes|
|00000770| 74 65 64 20 69 6e 0a 64 | 65 76 65 6c 6f 70 69 6e |ted in.d|evelopin|
|00000780| 67 20 70 6f 77 65 72 66 | 75 6c 20 65 78 74 65 6e |g powerf|ul exten|
|00000790| 73 69 62 6c 65 20 61 70 | 70 6c 69 63 61 74 69 6f |sible ap|plicatio|
|000007a0| 6e 73 20 77 69 74 68 20 | 68 69 67 68 20 71 75 61 |ns with |high qua|
|000007b0| 6c 69 74 79 20 58 0a 57 | 69 6e 64 6f 77 73 20 75 |lity X.W|indows u|
|000007c0| 73 65 72 20 69 6e 74 65 | 72 66 61 63 65 73 2e 20 |ser inte|rfaces. |
|000007d0| 20 54 68 65 20 64 69 73 | 63 75 73 73 69 6f 6e 20 | The dis|cussion |
|000007e0| 69 6e 20 74 68 69 73 20 | 63 68 61 70 74 65 72 20 |in this |chapter |
|000007f0| 63 61 6e 6e 6f 74 20 68 | 6f 70 65 0a 74 6f 20 61 |cannot h|ope.to a|
|00000800| 70 70 72 6f 61 63 68 20 | 74 68 65 20 6c 65 76 65 |pproach |the leve|
|00000810| 6c 20 6f 66 20 69 6e 74 | 72 6f 64 75 63 74 69 6f |l of int|roductio|
|00000820| 6e 20 70 72 6f 76 69 64 | 65 64 20 62 79 20 74 68 |n provid|ed by th|
|00000830| 61 74 20 62 6f 6f 6b 2e | 20 20 52 61 74 68 65 72 |at book.| Rather|
|00000840| 0a 77 65 20 77 69 6c 6c | 20 63 6f 6e 63 65 6e 74 |.we will| concent|
|00000850| 72 61 74 65 20 6f 6e 20 | 74 72 79 69 6e 67 20 74 |rate on |trying t|
|00000860| 6f 20 63 6f 6e 76 65 79 | 20 73 6f 6d 65 20 6f 66 |o convey| some of|
|00000870| 20 74 68 65 20 65 78 63 | 69 74 65 6d 65 6e 74 2c | the exc|itement,|
|00000880| 20 61 6e 64 0a 73 68 6f | 77 20 74 68 65 20 6e 75 | and.sho|w the nu|
|00000890| 74 73 20 61 6e 64 20 62 | 6f 6c 74 73 20 6f 66 20 |ts and b|olts of |
|000008a0| 75 73 69 6e 67 20 54 63 | 6c 20 61 6e 64 20 73 6f |using Tc|l and so|
|000008b0| 6d 65 20 65 78 74 65 6e | 73 69 6f 6e 73 20 74 6f |me exten|sions to|
|000008c0| 20 70 72 6f 76 69 64 65 | 20 61 0a 70 6f 77 65 72 | provide| a.power|
|000008d0| 66 75 6c 20 61 6e 64 20 | 66 6c 65 78 69 62 6c 65 |ful and |flexible|
|000008e0| 20 69 6e 74 65 72 66 61 | 63 65 20 74 6f 20 74 68 | interfa|ce to th|
|000008f0| 65 20 50 4c 70 6c 6f 74 | 20 6c 69 62 72 61 72 79 |e PLplot| library|
|00000900| 20 77 69 74 68 69 6e 20 | 79 6f 75 72 0a 61 70 70 | within |your.app|
|00000910| 6c 69 63 61 74 69 6f 6e | 2e 0a 0a 5c 62 65 67 69 |lication|...\begi|
|00000920| 6e 7b 6d 65 6e 75 7d 0a | 2a 20 4d 6f 74 69 76 61 |n{menu}.|* Motiva|
|00000930| 74 69 6f 6e 20 66 6f 72 | 20 54 63 6c 3a 3a 09 09 |tion for| Tcl::..|
|00000940| 57 68 79 20 54 63 6c 20 | 65 78 69 73 74 73 0a 2a |Why Tcl |exists.*|
|00000950| 20 43 61 70 61 62 69 6c | 69 74 69 65 73 20 6f 66 | Capabil|ities of|
|00000960| 20 54 63 6c 3a 3a 09 09 | 57 68 61 74 20 69 74 20 | Tcl::..|What it |
|00000970| 63 61 6e 20 64 6f 20 66 | 6f 72 20 79 6f 75 0a 2a |can do f|or you.*|
|00000980| 20 41 63 71 75 69 72 69 | 6e 67 20 54 63 6c 3a 3a | Acquiri|ng Tcl::|
|00000990| 09 09 57 68 65 72 65 20 | 74 6f 20 67 65 74 20 69 |..Where |to get i|
|000009a0| 74 2c 20 73 75 70 70 6f | 72 74 69 6e 67 20 74 6f |t, suppo|rting to|
|000009b0| 6f 6c 73 2c 20 65 74 63 | 2e 0a 5c 65 6e 64 7b 6d |ols, etc|..\end{m|
|000009c0| 65 6e 75 7d 0a 0a 5c 6e | 6f 64 65 20 4d 6f 74 69 |enu}..\n|ode Moti|
|000009d0| 76 61 74 69 6f 6e 20 66 | 6f 72 20 54 63 6c 2c 20 |vation f|or Tcl, |
|000009e0| 43 61 70 61 62 69 6c 69 | 74 69 65 73 20 6f 66 20 |Capabili|ties of |
|000009f0| 54 63 6c 2c 20 54 63 6c | 20 49 6e 74 72 6f 2c 20 |Tcl, Tcl| Intro, |
|00000a00| 54 63 6c 20 49 6e 74 72 | 6f 0a 5c 73 75 62 73 65 |Tcl Intr|o.\subse|
|00000a10| 63 74 69 6f 6e 7b 4d 6f | 74 69 76 61 74 69 6f 6e |ction{Mo|tivation|
|00000a20| 20 66 6f 72 20 54 63 6c | 7d 0a 0a 54 68 65 20 63 | for Tcl|}..The c|
|00000a30| 65 6e 74 72 61 6c 20 6f | 62 73 65 72 76 61 74 69 |entral o|bservati|
|00000a40| 6f 6e 20 77 68 69 63 68 | 20 6c 65 64 20 4f 75 73 |on which| led Ous|
|00000a50| 74 65 72 68 6f 75 74 20 | 74 6f 20 63 72 65 61 74 |terhout |to creat|
|00000a60| 65 20 54 63 6c 20 77 61 | 73 20 74 68 65 0a 72 65 |e Tcl wa|s the.re|
|00000a70| 61 6c 69 7a 61 74 69 6f | 6e 20 74 68 61 74 20 6d |alizatio|n that m|
|00000a80| 61 6e 79 20 61 70 70 6c | 69 63 61 74 69 6f 6e 73 |any appl|ications|
|00000a90| 20 72 65 71 75 69 72 65 | 20 74 68 65 20 75 73 65 | require| the use|
|00000aa0| 20 6f 66 20 73 6f 6d 65 | 20 73 6f 72 74 20 6f 66 | of some| sort of|
|00000ab0| 20 61 0a 73 70 65 63 69 | 61 6c 20 70 75 72 70 6f | a.speci|al purpo|
|00000ac0| 73 65 2c 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |se, appl|ication |
|00000ad0| 73 70 65 63 69 66 69 63 | 2c 20 65 6d 62 65 64 64 |specific|, embedd|
|00000ae0| 65 64 20 60 60 6d 61 63 | 72 6f 20 6c 61 6e 67 75 |ed ``mac|ro langu|
|00000af0| 61 67 65 27 27 2e 0a 41 | 70 70 6c 69 63 61 74 69 |age''..A|pplicati|
|00000b00| 6f 6e 20 70 72 6f 67 72 | 61 6d 6d 65 72 73 20 63 |on progr|ammers c|
|00000b10| 6f 62 62 6c 65 20 74 68 | 65 73 65 20 60 60 74 69 |obble th|ese ``ti|
|00000b20| 6e 79 20 6c 61 6e 67 75 | 61 67 65 73 27 27 20 69 |ny langu|ages'' i|
|00000b30| 6e 74 6f 20 74 68 65 69 | 72 0a 63 6f 64 65 73 20 |nto thei|r.codes |
|00000b40| 69 6e 20 6f 72 64 65 72 | 20 74 6f 20 70 72 6f 76 |in order| to prov|
|00000b50| 69 64 65 20 66 6c 65 78 | 69 62 69 6c 69 74 79 20 |ide flex|ibility |
|00000b60| 61 6e 64 20 73 6f 6d 65 | 20 6d 6f 64 69 63 75 6d |and some| modicum|
|00000b70| 20 6f 66 20 68 69 67 68 | 20 6c 65 76 65 6c 0a 63 | of high| level.c|
|00000b80| 6f 6e 74 72 6f 6c 2e 20 | 20 42 75 74 20 74 68 65 |ontrol. | But the|
|00000b90| 20 65 6e 64 20 72 65 73 | 75 6c 74 20 69 73 20 66 | end res|ult is f|
|00000ba0| 72 65 71 75 65 6e 74 6c | 79 20 61 20 71 75 69 72 |requentl|y a quir|
|00000bb0| 6b 79 20 61 6e 64 20 66 | 72 61 67 69 6c 65 0a 6c |ky and f|ragile.l|
|00000bc0| 61 6e 67 75 61 67 65 2e | 20 20 41 6e 64 20 65 61 |anguage.| And ea|
|00000bd0| 63 68 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 68 |ch appli|cation h|
|00000be0| 61 73 20 61 20 64 69 66 | 66 65 72 65 6e 74 20 60 |as a dif|ferent `|
|00000bf0| 60 74 69 6e 79 20 6c 61 | 6e 67 75 61 67 65 27 27 |`tiny la|nguage''|
|00000c00| 0a 61 73 73 6f 63 69 61 | 74 65 64 20 77 69 74 68 |.associa|ted with|
|00000c10| 20 69 74 2e 20 20 54 68 | 65 20 69 64 65 61 20 62 | it. Th|e idea b|
|00000c20| 65 68 69 6e 64 20 54 63 | 6c 2c 20 74 68 65 6e 2c |ehind Tc|l, then,|
|00000c30| 20 77 61 73 20 74 6f 20 | 63 72 65 61 74 65 20 61 | was to |create a|
|00000c40| 20 73 69 6e 67 6c 65 0a | 60 60 63 6f 72 65 20 6c | single.|``core l|
|00000c50| 61 6e 67 75 61 67 65 27 | 27 20 77 68 69 63 68 20 |anguage'|' which |
|00000c60| 63 6f 75 6c 64 20 62 65 | 20 65 61 73 69 6c 79 20 |could be| easily |
|00000c70| 65 6d 62 65 64 64 65 64 | 20 69 6e 74 6f 20 61 20 |embedded| into a |
|00000c80| 77 69 64 65 20 76 61 72 | 69 65 74 79 0a 6f 66 20 |wide var|iety.of |
|00000c90| 61 70 70 6c 69 63 61 74 | 69 6f 6e 73 2e 20 20 46 |applicat|ions. F|
|00000ca0| 75 72 74 68 65 72 2c 20 | 69 74 20 73 68 6f 75 6c |urther, |it shoul|
|00000cb0| 64 20 62 65 20 65 61 73 | 69 6c 79 20 65 78 74 65 |d be eas|ily exte|
|00000cc0| 6e 73 69 62 6c 65 20 73 | 6f 20 74 68 61 74 0a 69 |nsible s|o that.i|
|00000cd0| 6e 64 69 76 69 64 75 61 | 6c 20 61 70 70 6c 69 63 |ndividua|l applic|
|00000ce0| 61 74 69 6f 6e 73 20 63 | 61 6e 20 65 61 73 69 6c |ations c|an easil|
|00000cf0| 79 20 70 72 6f 76 69 64 | 65 20 61 70 70 6c 69 63 |y provid|e applic|
|00000d00| 61 74 69 6f 6e 20 73 70 | 65 63 69 66 69 63 0a 63 |ation sp|ecific.c|
|00000d10| 61 70 61 62 69 6c 69 74 | 69 65 73 20 61 76 61 69 |apabilit|ies avai|
|00000d20| 6c 61 62 6c 65 20 69 6e | 20 74 68 65 20 6d 61 63 |lable in| the mac|
|00000d30| 72 6f 20 6c 61 6e 67 75 | 61 67 65 20 69 74 73 65 |ro langu|age itse|
|00000d40| 6c 66 2c 20 77 68 69 6c | 65 20 73 74 69 6c 6c 0a |lf, whil|e still.|
|00000d50| 70 72 6f 76 69 64 69 6e | 67 20 61 20 72 6f 62 75 |providin|g a robu|
|00000d60| 73 74 2c 20 75 6e 69 66 | 6f 72 6d 20 73 79 6e 74 |st, unif|orm synt|
|00000d70| 61 78 20 61 63 72 6f 73 | 73 20 61 20 76 61 72 69 |ax acros|s a vari|
|00000d80| 65 74 79 20 6f 66 20 61 | 70 70 6c 69 63 61 74 69 |ety of a|pplicati|
|00000d90| 6f 6e 73 2e 0a 54 6f 20 | 73 61 79 20 74 68 61 74 |ons..To |say that|
|00000da0| 20 54 63 6c 20 73 61 74 | 69 73 66 69 65 73 20 74 | Tcl sat|isfies t|
|00000db0| 68 65 73 65 20 72 65 71 | 75 69 72 65 6d 65 6e 74 |hese req|uirement|
|00000dc0| 73 20 77 6f 75 6c 64 20 | 62 65 20 61 20 73 70 65 |s would |be a spe|
|00000dd0| 63 74 61 63 75 6c 61 72 | 0a 75 6e 64 65 72 73 74 |ctacular|.underst|
|00000de0| 61 74 65 6d 65 6e 74 2e | 0a 0a 5c 6e 6f 64 65 20 |atement.|..\node |
|00000df0| 43 61 70 61 62 69 6c 69 | 74 69 65 73 20 6f 66 20 |Capabili|ties of |
|00000e00| 54 63 6c 2c 20 41 63 71 | 75 69 72 69 6e 67 20 54 |Tcl, Acq|uiring T|
|00000e10| 63 6c 2c 20 4d 6f 74 69 | 76 61 74 69 6f 6e 20 66 |cl, Moti|vation f|
|00000e20| 6f 72 20 54 63 6c 2c 20 | 54 63 6c 20 49 6e 74 72 |or Tcl, |Tcl Intr|
|00000e30| 6f 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 43 61 |o.\subse|ction{Ca|
|00000e40| 70 61 62 69 6c 69 74 69 | 65 73 20 6f 66 20 54 63 |pabiliti|es of Tc|
|00000e50| 6c 7d 0a 0a 54 68 65 20 | 6d 65 63 68 61 6e 69 63 |l}..The |mechanic|
|00000e60| 73 20 6f 66 20 75 73 69 | 6e 67 20 54 63 6c 20 61 |s of usi|ng Tcl a|
|00000e70| 72 65 20 76 65 72 79 20 | 73 74 72 61 69 67 68 74 |re very |straight|
|00000e80| 66 6f 72 77 61 72 64 2e | 20 20 42 61 73 69 63 61 |forward.| Basica|
|00000e90| 6c 6c 79 20 79 6f 75 0a | 6a 75 73 74 20 68 61 76 |lly you.|just hav|
|00000ea0| 65 20 74 6f 20 69 6e 63 | 6c 75 64 65 20 74 68 65 |e to inc|lude the|
|00000eb0| 20 66 69 6c 65 20 5c 66 | 69 6c 65 7b 74 63 6c 2e | file \f|ile{tcl.|
|00000ec0| 68 7d 2c 20 69 73 73 75 | 65 20 73 6f 6d 65 20 41 |h}, issu|e some A|
|00000ed0| 50 49 20 63 61 6c 6c 73 | 20 74 6f 0a 63 72 65 61 |PI calls| to.crea|
|00000ee0| 74 65 20 61 20 54 63 6c | 20 69 6e 74 65 72 70 72 |te a Tcl| interpr|
|00000ef0| 65 74 65 72 2c 20 61 6e | 64 20 74 68 65 6e 20 65 |eter, an|d then e|
|00000f00| 76 61 6c 75 61 74 65 20 | 61 20 73 63 72 69 70 74 |valuate |a script|
|00000f10| 20 66 69 6c 65 20 6f 72 | 20 70 65 72 66 6f 72 6d | file or| perform|
|00000f20| 0a 6f 74 68 65 72 20 6f | 70 65 72 61 74 69 6f 6e |.other o|peration|
|00000f30| 73 20 73 75 70 70 6f 72 | 74 65 64 20 62 79 20 74 |s suppor|ted by t|
|00000f40| 68 65 20 54 63 6c 20 41 | 50 49 2e 20 20 54 68 65 |he Tcl A|PI. The|
|00000f50| 6e 20 6a 75 73 74 20 6c | 69 6e 6b 20 61 67 61 69 |n just l|ink agai|
|00000f60| 6e 73 74 20 0a 5c 66 69 | 6c 65 7b 6c 69 62 74 63 |nst .\fi|le{libtc|
|00000f70| 6c 2e 61 7d 20 61 6e 64 | 20 6f 66 66 20 79 6f 75 |l.a} and| off you|
|00000f80| 20 67 6f 2e 0a 0a 48 61 | 76 69 6e 67 20 64 6f 6e | go...Ha|ving don|
|00000f90| 65 20 74 68 69 73 2c 20 | 79 6f 75 20 68 61 76 65 |e this, |you have|
|00000fa0| 20 65 73 73 65 6e 74 69 | 61 6c 6c 79 20 63 72 65 | essenti|ally cre|
|00000fb0| 61 74 65 64 20 61 20 73 | 68 65 6c 6c 2e 20 20 54 |ated a s|hell. T|
|00000fc0| 68 61 74 20 69 73 2c 20 | 79 6f 75 72 0a 70 72 6f |hat is, |your.pro|
|00000fd0| 67 72 61 6d 20 63 61 6e | 20 6e 6f 77 20 65 78 65 |gram can| now exe|
|00000fe0| 63 75 74 65 20 73 68 65 | 6c 6c 20 73 63 72 69 70 |cute she|ll scrip|
|00000ff0| 74 73 20 69 6e 20 74 68 | 65 20 54 63 6c 20 6c 61 |ts in th|e Tcl la|
|00001000| 6e 67 75 61 67 65 2e 20 | 20 54 63 6c 0a 70 72 6f |nguage. | Tcl.pro|
|00001010| 76 69 64 65 73 20 73 75 | 70 70 6f 72 74 20 66 6f |vides su|pport fo|
|00001020| 72 20 62 61 73 69 63 20 | 63 6f 6e 74 72 6f 6c 20 |r basic |control |
|00001030| 66 6c 6f 77 2c 20 76 61 | 72 69 61 62 6c 65 20 73 |flow, va|riable s|
|00001040| 75 62 73 74 69 74 75 74 | 69 6f 6e 20 66 69 6c 65 |ubstitut|ion file|
|00001050| 0a 69 2f 6f 20 61 6e 64 | 20 73 75 62 72 6f 75 74 |.i/o and| subrout|
|00001060| 69 6e 65 73 2e 20 20 49 | 6e 20 61 64 64 69 74 69 |ines. I|n additi|
|00001070| 6f 6e 20 74 6f 20 74 68 | 65 20 62 75 69 6c 74 69 |on to th|e builti|
|00001080| 6e 20 54 63 6c 20 63 6f | 6d 6d 61 6e 64 73 2c 20 |n Tcl co|mmands, |
|00001090| 79 6f 75 20 63 61 6e 0a | 64 65 66 69 6e 65 20 79 |you can.|define y|
|000010a0| 6f 75 72 20 6f 77 6e 20 | 73 75 62 72 6f 75 74 69 |our own |subrouti|
|000010b0| 6e 65 73 20 61 73 20 54 | 63 6c 20 70 72 6f 63 65 |nes as T|cl proce|
|000010c0| 63 64 75 72 65 73 20 77 | 68 69 63 68 20 65 66 66 |cdures w|hich eff|
|000010d0| 65 63 74 69 76 65 6c 79 | 0a 62 65 63 6f 6d 65 20 |ectively|.become |
|000010e0| 6e 65 77 20 6b 65 79 77 | 6f 72 64 73 2e 0a 0a 42 |new keyw|ords...B|
|000010f0| 75 74 20 74 68 65 20 72 | 65 61 6c 20 70 6f 77 65 |ut the r|eal powe|
|00001100| 72 20 6f 66 20 74 68 69 | 73 20 61 70 70 72 6f 61 |r of thi|s approa|
|00001110| 63 68 20 69 73 20 74 6f | 20 61 64 64 20 6e 65 77 |ch is to| add new|
|00001120| 20 63 6f 6d 6d 61 6e 64 | 73 20 74 6f 20 74 68 65 | command|s to the|
|00001130| 0a 69 6e 74 65 72 70 72 | 65 74 74 65 72 20 77 68 |.interpr|etter wh|
|00001140| 69 63 68 20 61 72 65 20 | 72 65 61 6c 69 7a 65 64 |ich are |realized|
|00001150| 20 62 79 20 63 6f 6d 70 | 69 6c 65 64 20 43 20 63 | by comp|iled C c|
|00001160| 6f 64 65 20 69 6e 20 79 | 6f 75 72 0a 61 70 70 6c |ode in y|our.appl|
|00001170| 69 63 61 74 69 6f 6e 2e | 20 20 54 63 6c 20 70 72 |ication.| Tcl pr|
|00001180| 6f 76 69 64 65 73 20 61 | 20 73 74 72 61 69 67 68 |ovides a| straigh|
|00001190| 74 66 6f 72 77 61 72 64 | 20 41 50 49 20 63 61 6c |tforward| API cal|
|000011a0| 6c 20 77 68 69 63 68 20 | 61 6c 6c 6f 77 73 20 79 |l which |allows y|
|000011b0| 6f 75 0a 74 6f 20 72 65 | 67 69 73 74 65 72 20 61 |ou.to re|gister a|
|000011c0| 20 66 75 6e 63 74 69 6f | 6e 20 69 6e 20 79 6f 75 | functio|n in you|
|000011d0| 72 20 63 6f 64 65 20 74 | 6f 20 62 65 20 63 61 6c |r code t|o be cal|
|000011e0| 6c 65 64 20 77 68 65 6e | 65 76 65 72 20 74 68 65 |led when|ever the|
|000011f0| 0a 69 6e 74 65 72 70 72 | 65 74 74 65 72 20 63 6f |.interpr|etter co|
|00001200| 6d 65 73 20 61 63 72 6f | 73 73 20 61 20 73 70 65 |mes acro|ss a spe|
|00001210| 63 69 66 69 63 20 6b 65 | 79 77 6f 72 64 20 6f 66 |cific ke|yword of|
|00001220| 20 79 6f 75 72 20 63 68 | 6f 6f 73 69 6e 67 20 69 | your ch|oosing i|
|00001230| 6e 20 74 68 65 0a 73 68 | 65 6c 6c 20 73 63 72 69 |n the.sh|ell scri|
|00001240| 70 74 73 20 69 74 20 65 | 78 65 63 75 74 65 73 2e |pts it e|xecutes.|
|00001250| 0a 0a 54 68 69 73 20 66 | 61 63 69 6c 69 74 79 20 |..This f|acility |
|00001260| 61 6c 6c 6f 77 73 20 79 | 6f 75 20 77 69 74 68 20 |allows y|ou with |
|00001270| 74 72 65 6d 65 6e 64 6f | 75 73 20 65 61 73 65 2c |tremendo|us ease,|
|00001280| 20 74 6f 20 65 6e 64 6f | 77 20 79 6f 75 72 0a 61 | to endo|w your.a|
|00001290| 70 70 6c 69 63 61 74 69 | 6f 6e 20 77 69 74 68 20 |pplicati|on with |
|000012a0| 61 20 70 6f 77 65 72 66 | 75 6c 2c 20 72 6f 62 75 |a powerf|ul, robu|
|000012b0| 73 74 20 61 6e 64 20 66 | 75 6c 6c 20 66 65 61 74 |st and f|ull feat|
|000012c0| 75 72 65 64 20 6d 61 63 | 72 6f 20 6c 61 6e 67 75 |ured mac|ro langu|
|000012d0| 61 67 65 2c 0a 74 72 69 | 76 69 61 6c 6c 79 20 65 |age,.tri|vially e|
|000012e0| 78 74 65 6e 64 20 74 68 | 61 74 20 6d 61 63 72 6f |xtend th|at macro|
|000012f0| 20 6c 61 6e 67 75 61 67 | 65 20 77 69 74 68 20 6e | languag|e with n|
|00001300| 65 77 20 6b 65 79 77 6f | 72 64 73 20 77 68 69 63 |ew keywo|rds whic|
|00001310| 68 20 74 72 69 67 67 65 | 72 0a 65 78 65 63 75 74 |h trigge|r.execut|
|00001320| 69 6f 6e 20 6f 66 20 63 | 6f 6d 70 69 6c 65 64 20 |ion of c|ompiled |
|00001330| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 73 70 65 63 |applicat|ion spec|
|00001340| 69 66 69 63 20 63 6f 6d | 6d 61 6e 64 73 2c 20 61 |ific com|mands, a|
|00001350| 6e 64 20 74 68 65 72 65 | 62 79 20 72 61 69 73 65 |nd there|by raise|
|00001360| 0a 74 68 65 20 6c 65 76 | 65 6c 20 6f 66 20 69 6e |.the lev|el of in|
|00001370| 74 65 72 61 63 74 69 6f | 6e 20 77 69 74 68 20 79 |teractio|n with y|
|00001380| 6f 75 72 20 63 6f 64 65 | 20 74 6f 20 6f 6e 65 20 |our code| to one |
|00001390| 6f 66 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 73 |of essen|tially s|
|000013a0| 68 65 6c 6c 0a 70 72 6f | 67 72 61 6d 6d 69 6e 67 |hell.pro|gramming|
|000013b0| 20 76 69 61 20 73 63 72 | 69 70 74 20 65 64 69 74 | via scr|ipt edit|
|000013c0| 69 6e 67 2e 0a 0a 5c 6e | 6f 64 65 20 41 63 71 75 |ing...\n|ode Acqu|
|000013d0| 69 72 69 6e 67 20 54 63 | 6c 2c 20 2c 20 43 61 70 |iring Tc|l, , Cap|
|000013e0| 61 62 69 6c 69 74 69 65 | 73 20 6f 66 20 54 63 6c |abilitie|s of Tcl|
|000013f0| 2c 20 54 63 6c 20 49 6e | 74 72 6f 0a 5c 73 75 62 |, Tcl In|tro.\sub|
|00001400| 73 65 63 74 69 6f 6e 7b | 41 63 71 75 69 72 69 6e |section{|Acquirin|
|00001410| 67 20 54 63 6c 7d 0a 0a | 54 68 65 72 65 20 61 72 |g Tcl}..|There ar|
|00001420| 65 20 73 65 76 65 72 61 | 6c 20 69 6d 70 6f 72 74 |e severa|l import|
|00001430| 61 6e 74 20 73 6f 75 72 | 63 65 73 20 6f 66 20 69 |ant sour|ces of i|
|00001440| 6e 66 6f 20 61 6e 64 20 | 63 6f 64 65 20 66 6f 72 |nfo and |code for|
|00001450| 20 54 63 6c 2e 0a 44 65 | 66 69 6e 69 74 65 6c 79 | Tcl..De|finitely|
|00001460| 20 67 65 74 20 74 68 65 | 20 62 6f 6f 6b 20 6d 65 | get the| book me|
|00001470| 6e 74 69 6f 6e 65 64 20 | 61 62 6f 76 65 2e 20 20 |ntioned |above. |
|00001480| 54 68 65 20 54 63 6c 20 | 61 6e 64 20 54 6b 20 74 |The Tcl |and Tk t|
|00001490| 6f 6f 6c 6b 69 74 73 20 | 61 72 65 0a 64 69 73 74 |oolkits |are.dist|
|000014a0| 72 69 62 75 74 65 64 20 | 62 79 20 61 6e 6f 6e 79 |ributed |by anony|
|000014b0| 6d 6f 75 73 20 66 74 70 | 20 61 74 20 5c 66 69 6c |mous ftp| at \fil|
|000014c0| 65 7b 73 70 72 69 74 65 | 2e 62 65 72 6b 65 6c 65 |e{sprite|.berkele|
|000014d0| 79 2e 65 64 75 3a 2f 74 | 63 6c 7d 2e 0a 54 68 65 |y.edu:/t|cl}..The|
|000014e0| 72 65 20 61 72 65 20 73 | 65 76 65 72 61 6c 20 66 |re are s|everal f|
|000014f0| 69 6c 65 73 20 69 6e 20 | 74 68 65 72 65 20 63 6f |iles in |there co|
|00001500| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 74 6f 20 54 |rrespond|ing to T|
|00001510| 63 6c 2c 20 54 6b 2c 20 | 61 6e 64 20 76 61 72 69 |cl, Tk, |and vari|
|00001520| 6f 75 73 0a 66 6f 72 6d | 73 20 6f 66 20 64 6f 63 |ous.form|s of doc|
|00001530| 75 6d 65 6e 74 61 74 69 | 6f 6e 2e 20 20 41 74 20 |umentati|on. At |
|00001540| 74 68 65 20 74 69 6d 65 | 20 6f 66 20 74 68 69 73 |the time| of this|
|00001550| 20 77 72 69 74 69 6e 67 | 2c 20 74 68 65 20 63 75 | writing|, the cu|
|00001560| 72 72 65 6e 74 0a 76 65 | 72 73 69 6f 6e 73 20 6f |rrent.ve|rsions o|
|00001570| 66 20 54 63 6c 20 61 6e | 64 20 54 6b 20 61 72 65 |f Tcl an|d Tk are|
|00001580| 20 37 2e 33 20 61 6e 64 | 20 33 2e 36 20 72 65 73 | 7.3 and| 3.6 res|
|00001590| 70 65 63 74 69 76 65 6c | 79 2e 20 20 52 65 74 72 |pectivel|y. Retr|
|000015a0| 69 65 76 65 20 74 68 6f | 73 65 0a 66 69 6c 65 73 |ieve tho|se.files|
|000015b0| 2c 20 61 6e 64 20 69 6e | 73 74 61 6c 6c 20 75 73 |, and in|stall us|
|000015c0| 69 6e 67 20 74 68 65 20 | 69 6e 73 74 72 75 63 74 |ing the |instruct|
|000015d0| 69 6f 6e 73 20 70 72 6f | 76 69 64 65 64 20 74 68 |ions pro|vided th|
|000015e0| 65 72 65 69 6e 2e 0a 0a | 54 68 65 20 6f 74 68 65 |erein...|The othe|
|000015f0| 72 20 6d 61 6a 6f 72 20 | 61 6e 6f 6e 79 6d 6f 75 |r major |anonymou|
|00001600| 20 66 74 70 20 73 69 74 | 65 20 66 6f 72 20 54 63 | ftp sit|e for Tc|
|00001610| 6c 20 69 73 0a 5c 66 69 | 6c 65 7b 68 61 72 62 6f |l is.\fi|le{harbo|
|00001620| 72 2e 65 63 6e 2e 70 75 | 72 64 75 65 2e 65 64 75 |r.ecn.pu|rdue.edu|
|00001630| 3a 2f 70 75 62 2f 74 63 | 6c 7d 2e 20 20 48 61 72 |:/pub/tc|l}. Har|
|00001640| 62 6f 72 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 6d |bor cont|ains a m|
|00001650| 69 72 72 6f 72 20 6f 66 | 0a 5c 66 69 6c 65 7b 73 |irror of|.\file{s|
|00001660| 70 72 69 74 65 7d 20 61 | 73 20 77 65 6c 6c 20 61 |prite} a|s well a|
|00001670| 73 20 69 6e 6e 75 6d 65 | 72 61 62 6c 65 20 65 78 |s innume|rable ex|
|00001680| 74 65 6e 73 69 6f 6e 73 | 2c 20 54 63 6c 2f 54 6b |tensions|, Tcl/Tk|
|00001690| 20 70 61 63 6b 61 67 65 | 73 2c 0a 74 75 74 6f 72 | package|s,.tutor|
|000016a0| 69 61 6c 73 2c 20 64 6f | 63 75 6d 65 6e 74 61 74 |ials, do|cumentat|
|000016b0| 69 6f 6e 2c 20 65 74 63 | 2e 20 20 54 68 65 20 6c |ion, etc|. The l|
|000016c0| 65 76 65 6c 20 6f 66 20 | 65 78 63 69 74 65 6d 65 |evel of |exciteme|
|000016d0| 6e 74 20 69 6e 20 74 68 | 65 20 54 63 6c 0a 63 6f |nt in th|e Tcl.co|
|000016e0| 6d 6d 75 6e 69 74 79 20 | 69 73 20 65 78 74 72 61 |mmunity |is extra|
|000016f0| 6f 72 64 69 6e 61 72 69 | 6c 79 20 68 69 67 68 2c |ordinari|ly high,|
|00001700| 20 61 6e 64 20 74 68 69 | 73 20 69 73 20 72 65 66 | and thi|s is ref|
|00001710| 6c 65 63 74 65 64 20 62 | 79 20 74 68 65 20 67 72 |lected b|y the gr|
|00001720| 65 61 74 0a 70 6c 65 74 | 68 6f 72 61 20 6f 66 20 |eat.plet|hora of |
|00001730| 61 76 61 69 6c 61 62 6c | 65 2c 20 68 69 67 68 20 |availabl|e, high |
|00001740| 71 75 61 6c 69 74 79 2c | 20 70 61 63 6b 61 67 65 |quality,| package|
|00001750| 73 20 61 6e 64 20 65 78 | 74 65 6e 73 69 6f 6e 73 |s and ex|tensions|
|00001760| 20 61 76 61 69 6c 61 62 | 6c 65 0a 66 6f 72 20 75 | availab|le.for u|
|00001770| 73 65 20 77 69 74 68 20 | 54 63 6c 20 61 6e 64 20 |se with |Tcl and |
|00001780| 54 6b 2e 20 20 45 78 70 | 6c 6f 72 65 2d 2d 74 68 |Tk. Exp|lore--th|
|00001790| 65 72 65 20 69 73 20 64 | 65 66 69 6e 69 74 65 6c |ere is d|efinitel|
|000017a0| 79 20 73 6f 6d 65 74 68 | 69 6e 67 20 66 6f 72 0a |y someth|ing for.|
|000017b0| 65 76 65 72 79 6f 6e 65 | 2e 0a 0a 41 64 64 69 74 |everyone|...Addit|
|000017c0| 69 6f 6e 61 6c 6c 79 20 | 74 68 65 72 65 20 69 73 |ionally |there is|
|000017d0| 20 61 20 6e 65 77 73 67 | 72 6f 75 70 2c 20 5c 66 | a newsg|roup, \f|
|000017e0| 69 6c 65 7b 63 6f 6d 70 | 2e 6c 61 6e 67 2e 74 63 |ile{comp|.lang.tc|
|000017f0| 6c 7d 20 77 68 69 63 68 | 20 69 73 20 77 65 6c 6c |l} which| is well|
|00001800| 0a 72 65 61 64 2c 20 61 | 6e 64 20 61 6e 20 65 78 |.read, a|nd an ex|
|00001810| 63 65 6c 6c 65 6e 74 20 | 70 6c 61 63 65 20 66 6f |cellent |place fo|
|00001820| 72 20 70 65 6f 70 6c 65 | 20 74 6f 20 67 65 74 20 |r people| to get |
|00001830| 6f 72 69 65 6e 74 65 64 | 2c 20 66 69 6e 64 20 68 |oriented|, find h|
|00001840| 65 6c 70 2c 0a 65 74 63 | 2e 20 20 48 69 67 68 6c |elp,.etc|. Highl|
|00001850| 79 20 72 65 63 6f 6d 6d | 65 6e 64 65 64 2e 0a 0a |y recomm|ended...|
|00001860| 49 6e 20 61 6e 79 20 65 | 76 65 6e 74 2c 20 69 6e |In any e|vent, in|
|00001870| 20 6f 72 64 65 72 20 74 | 6f 20 75 73 65 20 74 68 | order t|o use th|
|00001880| 65 20 54 6b 20 61 6e 64 | 20 54 63 6c 2d 44 50 20 |e Tk and| Tcl-DP |
|00001890| 64 72 69 76 65 72 73 20 | 69 6e 20 50 4c 70 6c 6f |drivers |in PLplo|
|000018a0| 74 2c 20 79 6f 75 0a 77 | 69 6c 6c 20 6e 65 65 64 |t, you.w|ill need|
|000018b0| 20 61 74 20 61 20 6d 69 | 6e 69 75 6d 75 6d 2c 20 | at a mi|niumum, |
|000018c0| 5c 66 69 6c 65 7b 74 63 | 6c 37 2e 33 2e 74 61 72 |\file{tc|l7.3.tar|
|000018d0| 2e 67 7a 7d 2c 20 5c 66 | 69 6c 65 7b 74 6b 33 2e |.gz}, \f|ile{tk3.|
|000018e0| 36 2e 74 61 72 2e 67 7a | 7d 20 61 6e 64 0a 5c 66 |6.tar.gz|} and.\f|
|000018f0| 69 6c 65 7b 74 63 6c 2d | 64 70 2d 33 2e 31 2e 74 |ile{tcl-|dp-3.1.t|
|00001900| 61 72 2e 67 7a 7d 2e 20 | 20 41 64 64 69 74 69 6f |ar.gz}. | Additio|
|00001910| 6e 61 6c 6c 79 2c 20 69 | 6e 20 6f 72 64 65 72 20 |nally, i|n order |
|00001920| 74 6f 20 75 73 65 20 74 | 68 65 20 65 78 74 65 6e |to use t|he exten|
|00001930| 64 65 64 0a 57 49 53 48 | 20 70 61 72 61 64 69 67 |ded.WISH| paradig|
|00001940| 6d 20 28 64 65 73 63 72 | 69 62 65 64 20 62 65 6c |m (descr|ibed bel|
|00001950| 6f 77 29 20 79 6f 75 20 | 77 69 6c 6c 20 6e 65 65 |ow) you |will nee|
|00001960| 64 20 5c 66 69 6c 65 7b | 69 74 63 6c 2d 31 2e 35 |d \file{|itcl-1.5|
|00001970| 2e 74 61 72 2e 67 7a 7d | 2e 0a 42 65 63 61 75 73 |.tar.gz}|..Becaus|
|00001980| 65 20 6f 66 20 74 68 65 | 73 65 20 64 65 70 65 6e |e of the|se depen|
|00001990| 64 65 6e 63 69 65 73 2c | 20 74 68 65 20 50 4c 70 |dencies,| the PLp|
|000019a0| 6c 6f 74 20 66 74 70 20 | 61 72 63 68 69 76 65 20 |lot ftp |archive |
|000019b0| 73 69 74 65 20 70 72 6f | 76 69 64 65 73 0a 74 68 |site pro|vides.th|
|000019c0| 65 73 65 20 66 69 6c 65 | 73 20 61 73 20 77 65 6c |ese file|s as wel|
|000019d0| 6c 2e 20 20 59 6f 75 20 | 63 61 6e 20 72 65 74 72 |l. You |can retr|
|000019e0| 69 65 76 65 20 74 68 65 | 6d 20 77 68 65 6e 20 79 |ieve the|m when y|
|000019f0| 6f 75 20 67 65 74 20 50 | 4c 70 6c 6f 74 2e 0a 0a |ou get P|Lplot...|
|00001a00| 48 6f 77 65 76 65 72 2c | 20 79 6f 75 20 77 69 6c |However,| you wil|
|00001a10| 6c 20 71 75 69 74 65 20 | 6c 69 6b 65 6c 79 20 66 |l quite |likely f|
|00001a20| 69 6e 64 20 54 63 6c 2f | 54 6b 20 74 6f 20 62 65 |ind Tcl/|Tk to be|
|00001a30| 20 76 65 72 79 20 61 64 | 64 69 63 74 69 76 65 2c | very ad|dictive,|
|00001a40| 20 61 6e 64 0a 74 68 65 | 20 67 72 65 61 74 20 70 | and.the| great p|
|00001a50| 6c 65 74 68 6f 72 61 20 | 6f 66 20 61 64 64 2d 6f |lethora |of add-o|
|00001a60| 6e 73 20 61 76 61 69 6c | 61 62 6c 65 20 61 74 20 |ns avail|able at |
|00001a70| 5c 66 69 6c 65 7b 68 61 | 72 62 6f 72 7d 20 77 69 |\file{ha|rbor} wi|
|00001a80| 6c 0a 75 6e 64 6f 75 62 | 74 65 64 6c 79 20 61 74 |l.undoub|tedly at|
|00001a90| 74 72 61 63 74 20 6e 6f | 20 73 6d 61 6c 6c 20 61 |tract no| small a|
|00001aa0| 6d 6f 75 6e 74 20 6f 66 | 20 79 6f 75 72 20 61 74 |mount of| your at|
|00001ab0| 74 65 6e 74 69 6f 6e 2e | 20 20 49 74 20 68 61 73 |tention.| It has|
|00001ac0| 20 62 65 65 6e 0a 6f 75 | 72 20 65 78 70 65 72 69 | been.ou|r experi|
|00001ad0| 65 6e 63 65 20 74 68 61 | 74 20 61 6c 6c 20 6f 66 |ence tha|t all of|
|00001ae0| 20 74 68 65 73 65 20 65 | 78 74 65 6e 73 69 6f 6e | these e|xtension|
|00001af0| 73 20 66 69 74 20 74 6f | 67 65 74 68 65 72 20 76 |s fit to|gether v|
|00001b00| 65 72 79 20 77 65 6c 6c | 2e 0a 59 6f 75 20 77 69 |ery well|..You wi|
|00001b10| 6c 6c 20 20 66 69 6e 64 | 20 74 68 61 74 20 74 68 |ll find| that th|
|00001b20| 65 72 65 20 61 72 65 20 | 6c 61 72 67 65 20 73 65 |ere are |large se|
|00001b30| 63 74 6f 72 73 20 6f 66 | 20 74 68 65 20 54 63 6c |ctors of| the Tcl|
|00001b40| 20 75 73 65 72 20 63 6f | 6d 6d 75 6e 69 74 79 0a | user co|mmunity.|
|00001b50| 77 68 69 63 68 20 63 72 | 65 61 74 65 20 73 6f 2d |which cr|eate so-|
|00001b60| 63 61 6c 6c 65 64 20 60 | 60 4d 65 67 61 57 69 73 |called `|`MegaWis|
|00001b70| 68 65 73 27 27 20 77 68 | 69 63 68 20 63 6f 6d 62 |hes'' wh|ich comb|
|00001b80| 69 6e 65 20 6d 61 6e 79 | 20 6f 66 20 74 68 65 0a |ine many| of the.|
|00001b90| 61 76 61 69 6c 61 62 6c | 65 20 65 78 74 65 6e 73 |availabl|e extens|
|00001ba0| 69 6f 6e 73 20 69 6e 74 | 6f 20 61 20 73 69 6e 67 |ions int|o a sing|
|00001bb0| 6c 65 2c 20 68 65 61 76 | 69 6c 79 20 65 6d 62 65 |le, heav|ily embe|
|00001bc0| 6c 6c 69 73 68 65 64 2c | 20 73 68 65 6c 6c 0a 69 |llished,| shell.i|
|00001bd0| 6e 74 65 72 70 72 65 74 | 74 65 72 2e 20 20 54 68 |nterpret|ter. Th|
|00001be0| 65 20 62 65 6e 65 66 69 | 74 73 20 6f 66 20 74 68 |e benefi|ts of th|
|00001bf0| 69 73 20 61 70 70 72 6f | 61 63 68 20 77 69 6c 6c |is appro|ach will|
|00001c00| 20 62 65 63 6f 6d 65 20 | 61 70 70 61 72 65 6e 74 | become |apparent|
|00001c10| 20 61 73 0a 79 6f 75 20 | 67 61 69 6e 20 65 78 70 | as.you |gain exp|
|00001c20| 65 72 69 65 6e 63 65 20 | 77 69 74 68 20 54 63 6c |erience |with Tcl|
|00001c30| 20 61 6e 64 20 54 6b 2e | 0a 0a 5c 6e 6f 64 65 20 | and Tk.|..\node |
|00001c40| 54 6b 20 49 6e 74 72 6f | 2c 20 49 74 63 6c 20 49 |Tk Intro|, Itcl I|
|00001c50| 6e 74 72 6f 2c 20 54 63 | 6c 20 49 6e 74 72 6f 2c |ntro, Tc|l Intro,|
|00001c60| 20 45 78 74 65 6e 64 65 | 64 20 57 49 53 48 0a 5c | Extende|d WISH.\|
|00001c70| 73 65 63 74 69 6f 6e 7b | 49 6e 74 72 6f 64 75 63 |section{|Introduc|
|00001c80| 74 69 6f 6e 20 74 6f 20 | 54 6b 7d 0a 5c 63 69 6e |tion to |Tk}.\cin|
|00001c90| 64 65 78 7b 54 6b 7d 0a | 5c 63 69 6e 64 65 78 7b |dex{Tk}.|\cindex{|
|00001ca0| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 54 6b 7d 0a |Programm|ing Tk}.|
|00001cb0| 0a 41 73 20 6d 65 6e 74 | 69 6f 6e 65 64 20 61 62 |.As ment|ioned ab|
|00001cc0| 6f 76 65 2c 20 54 63 6c | 20 69 73 20 64 65 73 69 |ove, Tcl| is desi|
|00001cd0| 67 6e 65 64 20 74 6f 20 | 62 65 20 65 78 74 65 6e |gned to |be exten|
|00001ce0| 73 69 62 6c 65 2e 20 20 | 54 68 65 20 66 69 72 73 |sible. |The firs|
|00001cf0| 74 20 61 6e 64 0a 6d 6f | 73 74 20 62 61 73 69 63 |t and.mo|st basic|
|00001d00| 20 54 63 6c 20 65 78 74 | 65 6e 73 69 6f 6e 20 69 | Tcl ext|ension i|
|00001d10| 73 20 54 6b 2c 20 61 6e | 20 58 31 31 20 74 6f 6f |s Tk, an| X11 too|
|00001d20| 6c 6b 69 74 2e 20 20 54 | 6b 20 70 72 6f 76 69 64 |lkit. T|k provid|
|00001d30| 65 73 20 74 68 65 20 73 | 61 6d 65 0a 62 61 73 69 |es the s|ame.basi|
|00001d40| 63 20 66 61 63 69 6c 69 | 74 69 65 73 20 74 68 61 |c facili|ties tha|
|00001d50| 74 20 79 6f 75 20 6d 61 | 79 20 62 65 20 66 61 6d |t you ma|y be fam|
|00001d60| 69 6c 69 61 72 20 77 69 | 74 68 20 66 72 6f 6d 20 |iliar wi|th from |
|00001d70| 6f 74 68 65 72 20 58 31 | 31 20 74 6f 6f 6c 6b 69 |other X1|1 toolki|
|00001d80| 74 73 0a 73 75 63 68 20 | 61 73 20 41 74 68 65 6e |ts.such |as Athen|
|00001d90| 61 20 61 6e 64 20 4d 6f | 74 69 66 2c 20 65 78 63 |a and Mo|tif, exc|
|00001da0| 65 70 74 20 74 68 61 74 | 20 74 68 65 79 20 61 72 |ept that| they ar|
|00001db0| 65 20 70 72 6f 76 69 64 | 65 64 20 69 6e 20 74 68 |e provid|ed in th|
|00001dc0| 65 20 63 6f 6e 74 65 78 | 74 0a 6f 66 20 74 68 65 |e contex|t.of the|
|00001dd0| 20 54 63 6c 20 6c 61 6e | 67 75 61 67 65 2e 20 20 | Tcl lan|guage. |
|00001de0| 54 68 65 72 65 20 61 72 | 65 20 43 20 62 69 6e 64 |There ar|e C bind|
|00001df0| 69 6e 67 73 20 74 6f 6f | 2c 20 62 75 74 20 74 68 |ings too|, but th|
|00001e00| 65 73 65 20 61 72 65 20 | 73 65 6c 64 6f 6d 0a 6e |ese are |seldom.n|
|00001e10| 65 65 64 65 64 2d 2d 74 | 68 65 20 76 61 73 74 20 |eeded--t|he vast |
|00001e20| 6d 61 6a 6f 72 69 74 79 | 20 6f 66 20 75 73 65 66 |majority| of usef|
|00001e30| 75 6c 20 54 6b 20 61 70 | 70 6c 69 63 61 74 69 6f |ul Tk ap|plicatio|
|00001e40| 6e 73 20 63 61 6e 20 62 | 65 20 63 6f 64 65 64 20 |ns can b|e coded |
|00001e50| 75 73 69 6e 67 0a 54 63 | 6c 20 73 63 72 69 70 74 |using.Tc|l script|
|00001e60| 73 2e 0a 0a 49 66 20 69 | 74 20 68 61 73 20 6e 6f |s...If i|t has no|
|00001e70| 74 20 62 65 63 6f 6d 65 | 20 6f 62 76 69 6f 75 73 |t become| obvious|
|00001e80| 20 61 6c 72 65 61 64 79 | 2c 20 69 74 20 69 73 20 | already|, it is |
|00001e90| 77 6f 72 74 68 20 6e 6f | 74 69 6e 67 20 61 74 20 |worth no|ting at |
|00001ea0| 74 68 69 73 20 70 6f 69 | 6e 74 0a 74 68 61 74 20 |this poi|nt.that |
|00001eb0| 54 63 6c 20 69 73 20 6f | 6e 65 20 65 78 61 6d 70 |Tcl is o|ne examp|
|00001ec0| 6c 65 20 6f 66 20 61 20 | 66 61 6d 69 6c 79 20 6f |le of a |family o|
|00001ed0| 66 20 6c 61 6e 67 75 61 | 67 65 73 20 6b 6e 6f 77 |f langua|ges know|
|00001ee0| 6e 20 67 65 6e 65 72 61 | 6c 6c 79 20 61 73 0a 60 |n genera|lly as.`|
|00001ef0| 60 56 65 72 79 20 48 69 | 67 68 20 4c 65 76 65 6c |`Very Hi|gh Level|
|00001f00| 20 4c 61 6e 67 75 61 67 | 65 73 27 27 2c 20 6f 72 | Languag|es'', or|
|00001f10| 20 56 48 4c 4c 27 73 2e | 20 20 45 73 73 65 6e 74 | VHLL's.| Essent|
|00001f20| 69 61 6c 6c 79 20 61 20 | 56 48 4c 4c 20 72 61 69 |ially a |VHLL rai|
|00001f30| 73 65 73 0a 74 68 65 20 | 6c 65 76 65 6c 20 6f 66 |ses.the |level of|
|00001f40| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 74 6f 20 | program|ming to |
|00001f50| 61 20 76 65 72 79 20 68 | 69 67 68 20 6c 65 76 65 |a very h|igh leve|
|00001f60| 6c 2c 20 61 6c 6c 6f 77 | 69 6e 67 20 76 65 72 79 |l, allow|ing very|
|00001f70| 20 73 68 6f 72 74 0a 74 | 6f 6b 65 6e 20 73 74 72 | short.t|oken str|
|00001f80| 65 61 6d 73 20 74 6f 20 | 61 63 63 6f 6d 70 6c 69 |eams to |accompli|
|00001f90| 73 68 20 61 73 20 6d 75 | 63 68 20 61 73 20 77 6f |sh as mu|ch as wo|
|00001fa0| 75 6c 64 20 62 65 20 72 | 65 71 75 69 72 65 64 20 |uld be r|equired |
|00001fb0| 62 79 20 6d 61 6e 79 0a | 73 63 6f 72 65 73 20 6f |by many.|scores o|
|00001fc0| 66 20 74 68 65 20 6d 6f | 72 65 20 70 72 69 6d 69 |f the mo|re primi|
|00001fd0| 74 69 76 65 20 61 63 74 | 69 6f 6e 73 20 61 76 61 |tive act|ions ava|
|00001fe0| 69 6c 61 62 6c 65 20 69 | 6e 20 61 20 62 61 73 69 |ilable i|n a basi|
|00001ff0| 63 20 48 4c 4c 2e 0a 63 | 6f 6e 73 69 64 65 72 2c |c HLL..c|onsider,|
|00002000| 20 66 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 74 68 | for exa|mple, th|
|00002010| 65 20 62 61 73 69 63 20 | 60 60 48 65 6c 6c 6f 20 |e basic |``Hello |
|00002020| 57 6f 72 6c 64 21 27 27 | 20 61 70 70 6c 69 63 61 |World!''| applica|
|00002030| 74 69 6f 6e 20 77 72 69 | 74 74 65 6e 0a 69 6e 20 |tion wri|tten.in |
|00002040| 54 63 6c 2f 54 6b 2e 0a | 5c 62 65 67 69 6e 7b 76 |Tcl/Tk..|\begin{v|
|00002050| 65 72 62 61 74 69 6d 7d | 0a 23 21 2f 75 73 72 2f |erbatim}|.#!/usr/|
|00002060| 6c 6f 63 61 6c 2f 62 69 | 6e 2f 77 69 73 68 20 2d |local/bi|n/wish -|
|00002070| 66 0a 0a 62 75 74 74 6f | 6e 20 2e 68 65 6c 6c 6f |f..butto|n .hello|
|00002080| 20 2d 74 65 78 74 20 22 | 48 65 6c 6c 6f 20 57 6f | -text "|Hello Wo|
|00002090| 72 6c 64 21 22 20 20 2d | 63 6f 6d 6d 61 6e 64 20 |rld!" -|command |
|000020a0| 22 64 65 73 74 72 6f 79 | 20 2e 22 0a 70 61 63 6b |"destroy| .".pack|
|000020b0| 20 2e 68 65 6c 6c 6f 0a | 5c 65 6e 64 7b 76 65 72 | .hello.|\end{ver|
|000020c0| 62 61 74 69 6d 7d 0a 0a | 54 68 61 74 27 73 20 69 |batim}..|That's i|
|000020d0| 74 21 20 20 54 68 61 74 | 27 73 20 61 6c 6c 20 74 |t! That|'s all t|
|000020e0| 68 65 72 65 20 69 73 20 | 74 6f 20 69 74 2e 20 20 |here is |to it. |
|000020f0| 49 66 20 79 6f 75 20 68 | 61 76 65 20 65 76 65 72 |If you h|ave ever|
|00002100| 20 70 72 6f 67 72 61 6d | 6d 65 64 20 58 0a 75 73 | program|med X.us|
|00002110| 69 6e 67 20 61 20 74 72 | 61 64 69 74 69 6f 6e 61 |ing a tr|aditiona|
|00002120| 6c 20 74 6f 6f 6c 6b 69 | 74 20 73 75 63 68 20 61 |l toolki|t such a|
|00002130| 73 20 41 74 68 65 6e 61 | 20 6f 72 20 4d 6f 74 69 |s Athena| or Moti|
|00002140| 66 2c 20 79 6f 75 20 63 | 61 6e 0a 61 70 70 72 65 |f, you c|an.appre|
|00002150| 63 69 61 74 65 20 68 6f | 77 20 61 6d 61 7a 69 6e |ciate ho|w amazin|
|00002160| 67 6c 79 20 6d 75 63 68 | 20 6d 6f 72 65 20 63 6f |gly much| more co|
|00002170| 6e 76 65 6e 69 65 6e 74 | 20 74 68 69 73 20 69 73 |nvenient| this is|
|00002180| 2e 20 20 49 66 20 6e 6f | 74 2c 20 79 6f 75 0a 63 |. If no|t, you.c|
|00002190| 61 6e 20 65 69 74 68 65 | 72 20 74 61 6b 65 20 6f |an eithe|r take o|
|000021a0| 75 72 20 77 6f 72 64 20 | 66 6f 72 20 69 74 20 74 |ur word |for it t|
|000021b0| 68 61 74 20 74 68 69 73 | 20 69 73 20 32 30 20 74 |hat this| is 20 t|
|000021c0| 69 6d 65 73 20 6c 65 73 | 73 20 63 6f 64 65 20 74 |imes les|s code t|
|000021d0| 68 61 6e 0a 79 6f 75 20 | 77 6f 75 6c 64 20 6e 65 |han.you |would ne|
|000021e0| 65 64 20 74 6f 20 75 73 | 65 20 61 20 73 74 61 6e |ed to us|e a stan|
|000021f0| 64 61 72 64 20 74 6f 6f | 6c 6b 69 74 2c 20 6f 72 |dard too|lkit, or|
|00002200| 20 79 6f 75 20 63 61 6e | 20 67 6f 20 77 72 69 74 | you can| go writ|
|00002210| 65 20 74 68 65 20 73 61 | 6d 65 0a 70 72 6f 67 72 |e the sa|me.progr|
|00002220| 61 6d 20 69 6e 20 6f 6e | 65 20 6f 66 20 74 68 65 |am in on|e of the|
|00002230| 20 75 73 75 61 6c 20 74 | 6f 6f 6c 6b 69 74 73 20 | usual t|oolkits |
|00002240| 61 6e 64 20 73 65 65 20 | 66 6f 72 20 79 6f 75 72 |and see |for your|
|00002250| 73 65 6c 66 2e 2e 2e 0a | 0a 57 65 20 63 61 6e 6e |self....|.We cann|
|00002260| 6f 74 20 68 6f 70 65 20 | 74 6f 20 70 72 6f 76 69 |ot hope |to provi|
|00002270| 64 65 20 61 20 74 68 6f | 72 6f 75 67 68 20 69 6e |de a tho|rough in|
|00002280| 74 72 6f 64 75 63 74 69 | 6f 6e 20 74 6f 20 54 6b |troducti|on to Tk|
|00002290| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 69 6e 0a | program|ming in.|
|000022a0| 74 68 69 73 20 73 65 63 | 74 69 6f 6e 2e 20 20 49 |this sec|tion. I|
|000022b0| 6e 73 74 65 61 64 2c 20 | 77 65 20 77 69 6c 6c 20 |nstead, |we will |
|000022c0| 6a 75 73 74 20 73 61 79 | 20 74 68 61 74 20 69 6d |just say| that im|
|000022d0| 6d 65 6e 73 65 6c 79 20 | 63 6f 6d 70 6c 65 78 0a |mensely |complex.|
|000022e0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 73 20 63 61 6e |applicat|ions can|
|000022f0| 20 62 65 20 63 6f 6e 73 | 74 72 75 63 74 65 64 20 | be cons|tructed |
|00002300| 6d 65 72 65 6c 79 20 62 | 79 20 70 72 6f 67 72 61 |merely b|y progra|
|00002310| 6d 6d 69 6e 67 20 69 6e | 20 65 78 61 63 74 6c 79 |mming in| exactly|
|00002320| 20 74 68 65 0a 77 61 79 | 20 73 68 6f 77 6e 20 69 | the.way| shown i|
|00002330| 6e 20 74 68 65 20 61 62 | 6f 76 65 20 73 63 72 69 |n the ab|ove scri|
|00002340| 70 74 2e 20 20 42 79 20 | 77 72 69 74 69 6e 67 20 |pt. By |writing |
|00002350| 6d 6f 72 65 20 63 6f 6d | 70 6c 65 78 20 73 63 72 |more com|plex scr|
|00002360| 69 70 74 73 2c 20 61 6e | 64 0a 62 79 20 75 74 69 |ipts, an|d.by uti|
|00002370| 6c 69 7a 69 6e 67 20 74 | 68 65 20 61 64 64 69 74 |lizing t|he addit|
|00002380| 69 6f 6e 61 6c 20 77 69 | 64 67 67 65 74 73 20 70 |ional wi|dggets p|
|00002390| 72 6f 76 69 64 65 64 20 | 62 79 20 54 6b 2c 20 6f |rovided |by Tk, o|
|000023a0| 6e 65 20 63 61 6e 20 63 | 72 65 61 74 65 0a 62 65 |ne can c|reate.be|
|000023b0| 61 75 74 69 66 75 6c 2c | 20 65 78 74 65 6e 73 69 |autiful,| extensi|
|000023c0| 76 65 20 75 73 65 72 20 | 69 6e 74 65 72 66 61 63 |ve user |interfac|
|000023d0| 65 73 2e 20 20 4d 6f 72 | 65 6f 76 65 72 2c 20 74 |es. Mor|eover, t|
|000023e0| 68 69 73 20 63 61 6e 20 | 62 65 20 64 6f 6e 65 20 |his can |be done |
|000023f0| 69 6e 20 61 0a 74 69 6e | 79 20 66 72 61 63 74 69 |in a.tin|y fracti|
|00002400| 6f 6e 20 6f 66 20 74 68 | 65 20 74 69 6d 65 20 69 |on of th|e time i|
|00002410| 74 20 74 61 6b 65 73 20 | 74 6f 20 64 6f 20 74 68 |t takes |to do th|
|00002420| 65 20 73 61 6d 65 20 77 | 6f 72 6b 20 69 6e 20 61 |e same w|ork in a|
|00002430| 0a 63 6f 6e 76 65 6e 74 | 69 6f 6e 61 6c 20 74 6f |.convent|ional to|
|00002440| 6f 6c 6b 69 74 2e 20 20 | 4c 69 74 65 72 61 6c 6c |olkit. |Literall|
|00002450| 79 20 6d 69 6e 75 74 65 | 73 20 76 65 72 73 75 73 |y minute|s versus|
|00002460| 20 64 61 79 73 2e 0a 0a | 54 6b 20 70 72 6f 76 69 | days...|Tk provi|
|00002470| 64 65 73 20 77 69 64 67 | 65 74 73 20 66 6f 72 20 |des widg|ets for |
|00002480| 6c 61 62 65 6c 73 2c 20 | 62 75 74 74 6f 6e 73 2c |labels, |buttons,|
|00002490| 20 72 61 64 69 6f 20 62 | 75 74 74 6f 6e 73 2c 20 | radio b|uttons, |
|000024a0| 66 72 61 6d 65 73 20 77 | 69 74 68 20 6f 72 0a 77 |frames w|ith or.w|
|000024b0| 69 74 68 6f 75 74 20 62 | 6f 72 64 65 72 73 2c 20 |ithout b|orders, |
|000024c0| 6d 65 6e 75 62 61 72 73 | 2c 20 70 75 6c 6c 20 64 |menubars|, pull d|
|000024d0| 6f 77 6e 73 2c 20 74 6f | 70 6c 65 76 65 6c 73 2c |owns, to|plevels,|
|000024e0| 20 63 61 6e 76 61 73 65 | 73 2c 20 65 64 69 74 0a | canvase|s, edit.|
|000024f0| 62 6f 78 65 73 2c 20 73 | 63 72 6f 6c 6c 20 62 61 |boxes, s|croll ba|
|00002500| 72 73 2c 20 65 74 63 2e | 0a 0a 41 20 6c 6f 6f 6b |rs, etc.|..A look|
|00002510| 20 61 74 20 74 68 65 20 | 69 6e 74 65 72 66 61 63 | at the |interfac|
|00002520| 65 20 70 72 6f 76 69 64 | 65 64 20 62 79 20 74 68 |e provid|ed by th|
|00002530| 65 20 50 4c 70 6c 6f 74 | 20 54 6b 20 61 6e 64 20 |e PLplot| Tk and |
|00002540| 54 63 6c 2d 44 50 20 64 | 72 69 76 65 72 73 0a 73 |Tcl-DP d|rivers.s|
|00002550| 68 6f 75 6c 64 20 68 65 | 6c 70 20 67 69 76 65 20 |hould he|lp give |
|00002560| 79 6f 75 20 61 20 62 65 | 74 74 65 72 20 69 64 65 |you a be|tter ide|
|00002570| 61 20 6f 66 20 77 68 61 | 74 20 79 6f 75 20 63 61 |a of wha|t you ca|
|00002580| 6e 20 64 6f 20 77 69 74 | 68 20 74 68 69 73 0a 70 |n do wit|h this.p|
|00002590| 61 72 61 64 69 67 6d 2e | 20 20 41 6c 73 6f 20 63 |aradigm.| Also c|
|000025a0| 68 65 63 6b 20 6f 75 74 | 20 73 6f 6d 65 20 6f 66 |heck out| some of|
|000025b0| 20 74 68 65 20 63 6f 6e | 74 72 69 62 75 74 65 64 | the con|tributed|
|000025c0| 20 54 63 6c 2f 54 6b 20 | 70 61 63 6b 61 67 65 73 | Tcl/Tk |packages|
|000025d0| 0a 61 76 61 69 6c 61 62 | 6c 65 20 61 74 20 68 61 |.availab|le at ha|
|000025e0| 72 62 6f 72 2e 20 20 54 | 68 65 72 65 20 61 72 65 |rbor. T|here are|
|000025f0| 20 68 69 67 68 20 71 75 | 61 6c 69 74 79 20 54 6b | high qu|ality Tk|
|00002600| 20 69 6e 74 65 72 66 61 | 63 65 73 20 74 6f 20 61 | interfa|ces to a|
|00002610| 20 67 72 65 61 74 0a 6d | 61 6e 79 20 66 61 6d 69 | great.m|any fami|
|00002620| 6c 69 61 72 20 75 6e 69 | 78 20 75 74 69 6c 69 74 |liar uni|x utilit|
|00002630| 65 73 20 72 61 6e 67 69 | 6e 67 20 66 72 6f 6d 20 |es rangi|ng from |
|00002640| 6d 61 69 6c 20 74 6f 20 | 69 6e 66 6f 2c 20 74 6f |mail to |info, to|
|00002650| 20 53 51 4c 2c 20 74 6f | 0a 6e 65 77 73 2c 20 65 | SQL, to|.news, e|
|00002660| 74 63 2e 20 20 54 68 65 | 20 6c 69 73 74 20 69 73 |tc. The| list is|
|00002670| 20 65 6e 64 6c 65 73 73 | 20 61 6e 64 20 67 72 6f | endless| and gro|
|00002680| 77 69 6e 67 20 66 61 73 | 74 2e 2e 2e 0a 0a 5c 6e |wing fas|t.....\n|
|00002690| 6f 64 65 20 49 74 63 6c | 20 49 6e 74 72 6f 2c 20 |ode Itcl| Intro, |
|000026a0| 50 4c 70 6c 6f 74 20 45 | 78 74 65 6e 73 69 6f 6e |PLplot E|xtension|
|000026b0| 73 2c 20 54 6b 20 49 6e | 74 72 6f 2c 20 45 78 74 |s, Tk In|tro, Ext|
|000026c0| 65 6e 64 65 64 20 57 49 | 53 48 0a 5c 73 65 63 74 |ended WI|SH.\sect|
|000026d0| 69 6f 6e 7b 49 6e 74 72 | 6f 64 75 63 74 69 6f 6e |ion{Intr|oduction|
|000026e0| 20 74 6f 20 5b 69 6e 63 | 72 20 54 63 6c 5d 7d 0a | to [inc|r Tcl]}.|
|000026f0| 5c 63 69 6e 64 65 78 7b | 5b 69 6e 63 72 20 54 63 |\cindex{|[incr Tc|
|00002700| 6c 5d 7d 0a 5c 63 69 6e | 64 65 78 7b 6f 62 6a 65 |l]}.\cin|dex{obje|
|00002710| 63 74 20 6f 72 69 65 6e | 74 65 64 20 54 63 6c 7d |ct orien|ted Tcl}|
|00002720| 0a 0a 41 6e 6f 74 68 65 | 72 20 65 78 74 72 65 6d |..Anothe|r extrem|
|00002730| 65 6c 79 20 70 6f 77 65 | 72 66 75 6c 20 61 6e 64 |ely powe|rful and|
|00002740| 20 70 6f 70 75 6c 61 72 | 20 65 78 74 65 6e 73 69 | popular| extensi|
|00002750| 6f 6e 20 74 6f 20 54 63 | 6c 20 69 73 20 5b 69 6e |on to Tc|l is [in|
|00002760| 63 72 20 54 63 6c 5d 2e | 0a 5b 69 6e 63 72 20 54 |cr Tcl].|.[incr T|
|00002770| 63 6c 5d 20 69 73 20 74 | 6f 20 54 63 6c 20 77 68 |cl] is t|o Tcl wh|
|00002780| 61 74 20 43 2b 2b 20 69 | 73 20 74 6f 20 43 2e 20 |at C++ i|s to C. |
|00002790| 20 54 68 65 20 61 6e 61 | 6c 6f 67 79 20 69 73 20 | The ana|logy is |
|000027a0| 76 65 72 79 20 65 78 74 | 65 6e 73 69 76 65 2e 0a |very ext|ensive..|
|000027b0| 49 74 63 6c 20 70 72 6f | 76 69 64 65 73 20 61 6e |Itcl pro|vides an|
|000027c0| 20 6f 62 6a 65 63 74 20 | 6f 72 69 65 6e 74 61 74 | object |orientat|
|000027d0| 65 64 20 65 78 74 65 6e | 73 69 6f 6e 20 74 6f 20 |ed exten|sion to |
|000027e0| 54 63 6c 20 73 75 70 70 | 6f 72 74 69 6e 67 0a 63 |Tcl supp|orting.c|
|000027f0| 6c 75 73 74 65 72 69 6e | 67 20 6f 66 20 70 72 6f |lusterin|g of pro|
|00002800| 63 65 64 75 72 65 73 20 | 61 6e 64 20 64 61 74 61 |cedures |and data|
|00002810| 20 69 6e 74 6f 20 77 68 | 61 74 20 69 73 20 63 61 | into wh|at is ca|
|00002820| 6c 6c 65 64 20 61 6e 0a | 5c 63 6f 64 65 7b 69 74 |lled an.|\code{it|
|00002830| 63 6c 5f 63 6c 61 73 73 | 7d 2e 20 20 41 6e 20 5c |cl_class|}. An \|
|00002840| 63 6f 64 65 7b 69 74 63 | 6c 5f 63 6c 61 73 73 7d |code{itc|l_class}|
|00002850| 20 63 61 6e 20 68 61 76 | 65 20 6d 65 74 68 6f 64 | can hav|e method|
|00002860| 73 20 61 73 20 77 65 6c | 6c 20 61 73 0a 69 6e 73 |s as wel|l as.ins|
|00002870| 74 61 6e 63 65 20 64 61 | 74 61 2e 20 20 41 6e 64 |tance da|ta. And|
|00002880| 20 74 68 65 79 20 73 75 | 70 70 6f 72 74 20 69 6e | they su|pport in|
|00002890| 68 65 72 69 74 61 6e 63 | 65 2e 20 20 45 73 73 65 |heritanc|e. Esse|
|000028a0| 6e 74 69 61 6c 6c 79 20 | 69 66 20 79 6f 75 20 6b |ntially |if you k|
|000028b0| 6e 6f 77 0a 68 6f 77 20 | 43 2b 2b 20 72 65 6c 61 |now.how |C++ rela|
|000028c0| 74 65 73 20 74 6f 20 43 | 2c 20 61 6e 64 20 69 66 |tes to C|, and if|
|000028d0| 20 79 6f 75 20 6b 6e 6f | 77 20 54 63 6c 2c 20 74 | you kno|w Tcl, t|
|000028e0| 68 65 6e 20 79 6f 75 20 | 75 6e 64 65 72 73 74 61 |hen you |understa|
|000028f0| 6e 64 20 74 68 65 0a 70 | 72 6f 67 72 61 6d 6d 69 |nd the.p|rogrammi|
|00002900| 6e 67 20 6d 6f 64 65 6c | 20 70 72 6f 76 69 64 65 |ng model| provide|
|00002910| 64 20 62 79 20 49 74 63 | 6c 2e 0a 0a 49 6e 20 70 |d by Itc|l...In p|
|00002920| 61 72 74 69 63 75 6c 61 | 72 2c 20 79 6f 75 20 63 |articula|r, you c|
|00002930| 61 6e 20 75 73 65 20 49 | 74 63 6c 20 74 6f 20 69 |an use I|tcl to i|
|00002940| 6d 70 6c 65 6d 65 6e 74 | 20 6e 65 77 20 77 69 64 |mplement| new wid|
|00002950| 67 65 74 73 20 77 68 69 | 63 68 20 61 72 65 0a 63 |gets whi|ch are.c|
|00002960| 6f 6d 70 6f 73 65 64 20 | 6f 66 20 6d 6f 72 65 20 |omposed |of more |
|00002970| 62 61 73 69 63 20 54 6b | 20 77 69 64 67 65 74 73 |basic Tk| widgets|
|00002980| 2e 20 20 41 20 66 69 6c | 65 20 73 65 6c 65 63 74 |. A fil|e select|
|00002990| 6f 72 20 69 73 20 61 6e | 20 65 78 61 6d 70 6c 65 |or is an| example|
|000029a0| 2e 0a 55 73 69 6e 67 20 | 54 6b 2c 20 6f 6e 65 20 |..Using |Tk, one |
|000029b0| 63 61 6e 20 62 75 69 6c | 64 20 75 70 20 61 20 76 |can buil|d up a v|
|000029c0| 65 72 79 20 6e 69 63 65 | 20 66 69 6c 65 20 73 65 |ery nice| file se|
|000029d0| 6c 65 63 74 6f 72 20 63 | 6f 6d 70 72 69 73 65 64 |lector c|omprised|
|000029e0| 20 6f 66 20 6d 6f 72 65 | 0a 62 61 73 69 63 20 54 | of more|.basic T|
|000029f0| 6b 20 77 69 64 67 65 74 | 73 20 73 75 63 68 20 61 |k widget|s such a|
|00002a00| 73 20 65 6e 74 72 69 65 | 73 2c 20 6c 69 73 74 62 |s entrie|s, listb|
|00002a10| 6f 78 65 73 2c 20 73 63 | 72 6f 6c 6c 62 61 72 73 |oxes, sc|rollbars|
|00002a20| 2c 20 65 74 63 2e 0a 0a | 42 75 74 20 77 68 61 74 |, etc...|But what|
|00002a30| 20 69 66 20 79 6f 75 20 | 6e 65 65 64 20 74 77 6f | if you |need two|
|00002a40| 20 66 69 6c 65 20 73 65 | 6c 65 63 74 6f 72 73 3f | file se|lectors?|
|00002a50| 20 20 59 6f 75 20 68 61 | 76 65 20 74 6f 20 64 6f | You ha|ve to do|
|00002a60| 20 69 74 20 61 6c 6c 20 | 61 67 61 69 6e 2e 0a 4f | it all |again..O|
|00002a70| 72 20 77 68 61 74 20 69 | 66 20 79 6f 75 20 6e 65 |r what i|f you ne|
|00002a80| 65 64 20 74 77 6f 20 64 | 69 66 66 65 72 65 6e 74 |ed two d|ifferent|
|00002a90| 20 6b 69 6e 64 73 20 6f | 66 20 66 69 6c 65 20 73 | kinds o|f file s|
|00002aa0| 65 6c 65 63 74 6f 72 73 | 2c 20 79 6f 75 20 67 65 |electors|, you ge|
|00002ab0| 74 20 74 6f 0a 64 6f 20 | 69 74 20 61 67 61 69 6e |t to.do |it again|
|00002ac0| 20 61 6e 64 20 61 64 64 | 20 73 6f 6d 65 20 69 6e | and add| some in|
|00002ad0| 63 72 65 6d 65 6e 74 61 | 6c 20 63 6f 64 65 2e 0a |crementa|l code..|
|00002ae0| 0a 54 68 69 73 20 69 73 | 20 65 78 61 63 74 6c 79 |.This is| exactly|
|00002af0| 20 74 68 65 20 73 6f 72 | 74 20 6f 66 20 74 68 69 | the sor|t of thi|
|00002b00| 6e 67 20 6f 62 6a 65 63 | 74 20 6f 72 69 65 6e 74 |ng objec|t orient|
|00002b10| 61 74 69 6f 6e 20 69 73 | 20 69 6e 74 65 6e 64 65 |ation is| intende|
|00002b20| 64 20 74 6f 0a 61 73 73 | 69 73 74 2e 20 20 55 73 |d to.ass|ist. Us|
|00002b30| 69 6e 67 20 49 74 63 6c | 20 79 6f 75 20 63 61 6e |ing Itcl| you can|
|00002b40| 20 63 72 65 61 74 65 20 | 61 6e 20 5c 63 6f 64 65 | create |an \code|
|00002b50| 7b 69 74 63 6c 5f 63 6c | 61 73 73 20 46 69 6c 65 |{itcl_cl|ass File|
|00002b60| 53 65 6c 65 63 74 6f 72 | 7d 0a 61 6e 64 20 74 68 |Selector|}.and th|
|00002b70| 65 6e 20 79 6f 75 20 63 | 61 6e 20 69 6e 73 74 61 |en you c|an insta|
|00002b80| 6e 74 69 61 74 65 20 74 | 68 65 6d 20 66 72 65 65 |ntiate t|hem free|
|00002b90| 6c 79 20 61 73 20 65 61 | 73 69 6c 79 20 61 73 3a |ly as ea|sily as:|
|00002ba0| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00002bb0| 7d 0a 20 20 20 20 46 69 | 6c 65 53 65 6c 65 63 74 |}. Fi|leSelect|
|00002bc0| 6f 72 20 2e 66 73 31 0a | 20 20 20 20 2e 66 73 31 |or .fs1.| .fs1|
|00002bd0| 20 2d 64 69 72 20 2e 20 | 2d 66 69 6e 64 20 22 2a | -dir . |-find "*|
|00002be0| 2e 63 63 22 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |.cc".\en|d{verbat|
|00002bf0| 69 6d 7d 0a 61 6e 64 20 | 73 6f 20 66 6f 72 74 68 |im}.and |so forth|
|00002c00| 2e 0a 0a 54 68 65 73 65 | 20 68 69 67 68 20 6c 65 |...These| high le|
|00002c10| 76 65 6c 20 77 69 64 67 | 65 74 73 20 63 6f 6d 70 |vel widg|ets comp|
|00002c20| 6f 73 65 64 20 6f 66 20 | 73 6d 61 6c 6c 65 72 20 |osed of |smaller |
|00002c30| 54 6b 20 77 69 64 67 65 | 74 73 2c 20 61 72 65 20 |Tk widge|ts, are |
|00002c40| 6b 6e 6f 77 6e 20 61 73 | 0a 60 60 6d 65 67 61 77 |known as|.``megaw|
|00002c50| 69 64 67 65 74 73 27 27 | 2e 20 20 54 68 65 72 65 |idgets''|. There|
|00002c60| 20 69 73 20 61 20 64 65 | 76 65 6c 6f 70 69 6e 67 | is a de|veloping|
|00002c70| 20 73 75 62 63 75 6c 74 | 75 72 65 20 6f 66 20 74 | subcult|ure of t|
|00002c80| 68 65 20 54 63 6c 2f 54 | 6b 0a 63 6f 6d 6d 75 6e |he Tcl/T|k.commun|
|00002c90| 69 74 79 20 66 6f 72 20 | 64 65 73 69 67 6e 69 6e |ity for |designin|
|00002ca0| 67 20 61 6e 64 20 69 6d | 70 6c 65 6d 65 6e 74 69 |g and im|plementi|
|00002cb0| 6e 67 20 6d 65 67 61 77 | 69 64 67 65 74 73 2c 20 |ng megaw|idgets, |
|00002cc0| 61 6e 64 20 5b 69 6e 63 | 72 20 54 63 6c 5d 0a 69 |and [inc|r Tcl].i|
|00002cd0| 73 20 74 68 65 20 6d 6f | 73 74 20 70 6f 70 75 6c |s the mo|st popul|
|00002ce0| 61 72 20 65 6e 61 62 6c | 69 6e 67 20 74 65 63 68 |ar enabl|ing tech|
|00002cf0| 6e 6f 6c 6f 67 79 2e 0a | 0a 49 6e 20 70 61 72 74 |nology..|.In part|
|00002d00| 69 63 75 6c 61 72 2c 20 | 69 74 20 69 73 20 74 68 |icular, |it is th|
|00002d10| 65 20 65 6e 61 62 6c 69 | 6e 67 20 74 65 63 68 6e |e enabli|ng techn|
|00002d20| 6f 6c 6f 67 79 20 77 68 | 69 63 68 20 69 73 20 65 |ology wh|ich is e|
|00002d30| 6d 70 6c 6f 79 65 64 20 | 66 6f 72 20 74 68 65 0a |mployed |for the.|
|00002d40| 63 6f 6e 73 74 72 75 63 | 74 69 6f 6e 20 6f 66 20 |construc|tion of |
|00002d50| 74 68 65 20 50 4c 70 6c | 6f 74 20 54 63 6c 20 65 |the PLpl|ot Tcl e|
|00002d60| 78 74 65 6e 73 69 6f 6e | 73 2c 20 64 65 73 63 72 |xtension|s, descr|
|00002d70| 69 62 65 64 20 62 65 6c | 6f 77 2e 0a 0a 5c 6e 6f |ibed bel|ow...\no|
|00002d80| 64 65 20 50 4c 70 6c 6f | 74 20 45 78 74 65 6e 73 |de PLplo|t Extens|
|00002d90| 69 6f 6e 73 2c 20 43 75 | 73 74 6f 6d 20 45 78 74 |ions, Cu|stom Ext|
|00002da0| 65 6e 73 69 6f 6e 73 2c | 20 49 74 63 6c 20 49 6e |ensions,| Itcl In|
|00002db0| 74 72 6f 2c 20 45 78 74 | 65 6e 64 65 64 20 57 49 |tro, Ext|ended WI|
|00002dc0| 53 48 0a 5c 73 65 63 74 | 69 6f 6e 7b 50 4c 70 6c |SH.\sect|ion{PLpl|
|00002dd0| 6f 74 20 45 78 74 65 6e | 73 69 6f 6e 73 20 74 6f |ot Exten|sions to|
|00002de0| 20 54 63 6c 7d 0a 5c 63 | 69 6e 64 65 78 7b 50 4c | Tcl}.\c|index{PL|
|00002df0| 70 6c 6f 74 20 54 63 6c | 20 65 78 74 65 6e 73 69 |plot Tcl| extensi|
|00002e00| 6f 6e 7d 0a 5c 63 69 6e | 64 65 78 7b 54 63 6c 20 |on}.\cin|dex{Tcl |
|00002e10| 65 78 74 65 6e 73 69 6f | 6e 7d 0a 0a 46 6f 6c 6c |extensio|n}..Foll|
|00002e20| 6f 77 69 6e 67 20 74 68 | 65 20 70 61 72 61 64 69 |owing th|e paradi|
|00002e30| 67 6d 20 64 65 73 63 72 | 69 62 65 64 20 61 62 6f |gm descr|ibed abo|
|00002e40| 76 65 2c 20 50 4c 70 6c | 6f 74 20 70 72 6f 76 69 |ve, PLpl|ot provi|
|00002e50| 64 65 73 20 65 78 74 65 | 6e 73 69 6f 6e 73 20 74 |des exte|nsions t|
|00002e60| 6f 0a 54 63 6c 20 61 73 | 20 77 65 6c 6c 2c 20 64 |o.Tcl as| well, d|
|00002e70| 65 73 69 67 6e 65 64 20 | 74 6f 20 61 6c 6c 6f 77 |esigned |to allow|
|00002e80| 20 74 68 65 20 75 73 65 | 20 6f 66 20 50 4c 70 6c | the use| of PLpl|
|00002e90| 6f 74 20 66 72 6f 6d 20 | 54 63 6c 2f 54 6b 20 70 |ot from |Tcl/Tk p|
|00002ea0| 72 6f 67 72 61 6d 73 2e | 0a 45 73 73 65 6e 74 69 |rograms.|.Essenti|
|00002eb0| 61 6c 6c 79 20 74 68 65 | 20 69 64 65 61 20 68 65 |ally the| idea he|
|00002ec0| 72 65 20 69 73 20 74 6f | 20 61 6c 6c 6f 77 20 50 |re is to| allow P|
|00002ed0| 4c 70 6c 6f 74 20 70 72 | 6f 67 72 61 6d 6d 65 72 |Lplot pr|ogrammer|
|00002ee0| 73 20 74 6f 20 61 63 68 | 69 65 76 65 0a 74 77 6f |s to ach|ieve.two|
|00002ef0| 20 67 6f 61 6c 73 3a 0a | 5c 62 65 67 69 6e 7b 69 | goals:.|\begin{i|
|00002f00| 74 65 6d 69 7a 65 7d 0a | 5c 69 74 65 6d 20 54 6f |temize}.|\item To|
|00002f10| 20 61 63 63 65 73 73 20 | 50 4c 70 6c 6f 74 20 66 | access |PLplot f|
|00002f20| 61 63 69 6c 74 69 65 73 | 20 66 72 6f 6d 20 74 68 |acilties| from th|
|00002f30| 65 69 72 20 6f 77 6e 20 | 65 78 74 65 6e 64 65 64 |eir own |extended|
|00002f40| 20 57 49 53 48 20 61 6e | 64 2f 6f 72 0a 54 63 6c | WISH an|d/or.Tcl|
|00002f50| 2f 54 6b 20 75 73 65 72 | 20 69 6e 74 65 72 66 61 |/Tk user| interfa|
|00002f60| 63 65 20 73 63 72 69 70 | 74 73 2e 0a 0a 5c 69 74 |ce scrip|ts...\it|
|00002f70| 65 6d 20 54 6f 20 68 61 | 76 65 20 50 4c 70 6c 6f |em To ha|ve PLplo|
|00002f80| 74 20 64 69 73 70 6c 61 | 79 20 69 74 73 20 6f 75 |t displa|y its ou|
|00002f90| 74 70 75 74 20 69 6e 20 | 61 20 77 69 6e 64 6f 77 |tput in |a window|
|00002fa0| 20 69 6e 74 65 67 72 61 | 74 65 64 0a 64 69 72 65 | integra|ted.dire|
|00002fb0| 63 74 6c 79 20 69 6e 74 | 6f 20 74 68 65 20 72 65 |ctly int|o the re|
|00002fc0| 73 74 20 6f 66 20 74 68 | 65 69 72 20 54 63 6c 2f |st of th|eir Tcl/|
|00002fd0| 54 6b 20 69 6e 74 65 72 | 66 61 63 65 2e 0a 5c 65 |Tk inter|face..\e|
|00002fe0| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0a 0a 46 6f 72 |nd{itemi|ze}..For|
|00002ff0| 20 69 6e 73 74 61 6e 63 | 65 2c 20 70 72 69 6f 72 | instanc|e, prior|
|00003000| 20 74 6f 20 50 4c 70 6c | 6f 74 20 35 2e 30 2c 20 | to PLpl|ot 5.0, |
|00003010| 69 66 20 61 20 70 72 6f | 67 72 61 6d 6d 65 72 20 |if a pro|grammer |
|00003020| 77 61 6e 74 65 64 20 74 | 6f 20 75 73 65 0a 50 4c |wanted t|o use.PL|
|00003030| 70 6c 6f 74 20 69 6e 20 | 61 20 54 63 6c 2f 54 6b |plot in |a Tcl/Tk|
|00003040| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2c 20 74 68 | applica|tion, th|
|00003050| 65 20 62 65 73 74 20 68 | 65 20 63 6f 75 6c 64 20 |e best h|e could |
|00003060| 6d 61 6e 61 67 65 20 77 | 61 73 20 74 6f 20 63 61 |manage w|as to ca|
|00003070| 6c 6c 0a 74 68 65 20 50 | 4c 70 6c 6f 74 20 43 20 |ll.the P|Lplot C |
|00003080| 61 70 69 20 66 72 6f 6d | 20 63 6f 6d 70 69 6c 65 |api from| compile|
|00003090| 64 20 43 20 63 6f 64 65 | 2c 20 61 6e 64 20 67 65 |d C code|, and ge|
|000030a0| 74 20 74 68 65 20 6f 75 | 74 70 75 74 20 76 69 61 |t the ou|tput via|
|000030b0| 20 74 68 65 20 58 77 69 | 6e 0a 64 72 69 76 65 72 | the Xwi|n.driver|
|000030c0| 2c 20 77 68 69 63 68 20 | 77 6f 75 6c 64 20 64 69 |, which |would di|
|000030d0| 73 70 6c 61 79 20 69 6e | 20 69 74 27 73 20 6f 77 |splay in| it's ow|
|000030e0| 6e 20 74 6f 70 6c 65 76 | 65 6c 20 77 69 6e 64 6f |n toplev|el windo|
|000030f0| 77 2e 20 20 49 6e 20 6f | 74 68 65 72 0a 77 6f 72 |w. In o|ther.wor|
|00003100| 64 73 2c 20 74 68 65 72 | 65 20 77 61 73 20 6e 6f |ds, ther|e was no|
|00003110| 20 69 6e 74 65 67 72 61 | 74 69 6f 6e 2c 20 61 6e | integra|tion, an|
|00003120| 64 20 74 68 65 20 72 65 | 73 75 6c 74 20 77 61 73 |d the re|sult was|
|00003130| 20 70 72 65 74 74 79 20 | 73 6c 6f 70 70 79 2e 0a | pretty |sloppy..|
|00003140| 0a 57 69 74 68 20 50 4c | 70 6c 6f 74 20 35 2e 30 |.With PL|plot 5.0|
|00003150| 2c 20 74 68 65 72 65 20 | 69 73 20 6e 6f 77 20 61 |, there |is now a|
|00003160| 20 73 75 70 70 6f 72 74 | 65 64 20 54 63 6c 20 69 | support|ed Tcl i|
|00003170| 6e 74 65 72 66 61 63 65 | 20 74 6f 20 50 4c 70 6c |nterface| to PLpl|
|00003180| 6f 74 0a 66 75 6e 63 74 | 69 6f 6e 61 6c 69 74 79 |ot.funct|ionality|
|00003190| 2e 20 20 54 68 69 73 20 | 69 73 20 70 72 6f 76 69 |. This |is provi|
|000031a0| 64 65 64 20 74 68 72 6f | 75 67 68 20 61 20 60 60 |ded thro|ugh a ``|
|000031b0| 66 61 6d 69 6c 79 27 27 | 20 6f 66 20 50 4c 70 6c |family''| of PLpl|
|000031c0| 6f 74 0a 6d 65 67 61 77 | 69 64 67 65 74 73 20 69 |ot.megaw|idgets i|
|000031d0| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 69 6e 20 5b 69 |mplement|ed in [i|
|000031e0| 6e 63 72 20 54 63 6c 5d | 2e 20 20 55 73 69 6e 67 |ncr Tcl]|. Using|
|000031f0| 20 74 68 69 73 20 69 6e | 74 65 72 66 61 63 65 2c | this in|terface,|
|00003200| 20 61 0a 70 72 6f 67 72 | 61 6d 6d 65 72 20 63 61 | a.progr|ammer ca|
|00003210| 6e 20 67 65 74 20 61 20 | 50 4c 70 6c 6f 74 20 77 |n get a |PLplot w|
|00003220| 69 6e 64 6f 77 2f 77 69 | 64 67 65 74 20 69 6e 74 |indow/wi|dget int|
|00003230| 6f 20 61 20 54 6b 20 69 | 6e 74 65 72 66 61 63 65 |o a Tk i|nterface|
|00003240| 20 61 73 0a 65 61 73 69 | 6c 79 20 61 73 3a 0a 5c | as.easi|ly as:.\|
|00003250| 62 65 67 69 6e 7b 65 78 | 61 6d 70 6c 65 7d 0a 50 |begin{ex|ample}.P|
|00003260| 4c 57 69 6e 20 2e 70 6c | 77 0a 70 61 63 6b 20 2e |LWin .pl|w.pack .|
|00003270| 70 6c 77 0a 5c 65 6e 64 | 7b 65 78 61 6d 70 6c 65 |plw.\end|{example|
|00003280| 7d 0a 41 63 74 75 61 6c | 6c 79 2c 20 74 68 65 72 |}.Actual|ly, ther|
|00003290| 65 27 73 20 74 68 65 20 | 75 70 64 61 74 65 2f 69 |e's the |update/i|
|000032a0| 6e 69 74 20 62 75 73 69 | 6e 65 73 73 2d 2d 6e 65 |nit busi|ness--ne|
|000032b0| 65 64 20 74 6f 20 63 6c | 65 61 72 20 74 68 61 74 |ed to cl|ear that|
|000032c0| 20 75 70 2e 0a 0a 54 68 | 65 20 5c 63 6f 64 65 7b | up...Th|e \code{|
|000032d0| 50 4c 57 69 6e 7d 20 63 | 6c 61 73 73 20 74 68 65 |PLWin} c|lass the|
|000032e0| 6e 20 6d 69 72 72 6f 72 | 73 20 6d 75 63 68 20 6f |n mirror|s much o|
|000032f0| 66 20 74 68 65 20 50 4c | 70 6c 6f 74 20 43 20 41 |f the PL|plot C A|
|00003300| 50 49 2c 20 73 6f 20 74 | 68 61 74 0a 61 20 75 73 |PI, so t|hat.a us|
|00003310| 65 72 20 63 61 6e 20 67 | 65 6e 65 72 61 74 65 20 |er can g|enerate |
|00003320| 70 6c 6f 74 73 20 69 6e | 20 74 68 65 20 50 4c 70 |plots in| the PLp|
|00003330| 6c 6f 74 20 77 69 64 67 | 65 74 20 65 6e 74 69 72 |lot widg|et entir|
|00003340| 65 6c 79 20 66 72 6f 6d | 20 54 63 6c 2e 0a 54 68 |ely from| Tcl..Th|
|00003350| 69 73 20 69 73 20 64 65 | 6d 6f 6e 73 74 72 61 74 |is is de|monstrat|
|00003360| 65 64 20 69 6e 20 74 68 | 65 20 5c 66 69 6c 65 7b |ed in th|e \file{|
|00003370| 74 6b 30 32 7d 20 64 65 | 6d 6f 2c 0a 0a 5c 6e 6f |tk02} de|mo,..\no|
|00003380| 64 65 20 43 75 73 74 6f | 6d 20 45 78 74 65 6e 73 |de Custo|m Extens|
|00003390| 69 6f 6e 73 2c 20 2c 20 | 50 4c 70 6c 6f 74 20 45 |ions, , |PLplot E|
|000033a0| 78 74 65 6e 73 69 6f 6e | 73 2c 20 45 78 74 65 6e |xtension|s, Exten|
|000033b0| 64 65 64 20 57 49 53 48 | 0a 5c 73 65 63 74 69 6f |ded WISH|.\sectio|
|000033c0| 6e 7b 43 75 73 74 6f 6d | 20 45 78 74 65 6e 73 69 |n{Custom| Extensi|
|000033d0| 6f 6e 73 20 74 6f 20 54 | 63 6c 7d 0a 0a 42 79 20 |ons to T|cl}..By |
|000033e0| 74 68 69 73 20 70 6f 69 | 6e 74 2c 20 79 6f 75 20 |this poi|nt, you |
|000033f0| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 61 20 70 72 |should h|ave a pr|
|00003400| 65 74 74 79 20 64 65 63 | 65 6e 74 20 75 6e 64 65 |etty dec|ent unde|
|00003410| 72 73 74 61 6e 64 69 6e | 67 20 6f 66 20 74 68 65 |rstandin|g of the|
|00003420| 0a 75 6e 64 65 72 6c 79 | 69 6e 67 20 70 68 69 6c |.underly|ing phil|
|00003430| 6f 73 6f 70 68 79 20 6f | 66 20 54 63 6c 20 61 6e |osophy o|f Tcl an|
|00003440| 64 20 54 6b 2c 20 61 6e | 64 20 74 68 65 20 77 68 |d Tk, an|d the wh|
|00003450| 6f 6c 65 20 63 6f 6e 63 | 65 70 74 20 6f 66 0a 65 |ole conc|ept of.e|
|00003460| 78 74 65 6e 73 69 6f 6e | 73 2c 20 6f 66 20 77 68 |xtension|s, of wh|
|00003470| 69 63 68 20 5b 69 6e 63 | 72 20 54 63 6c 5d 20 61 |ich [inc|r Tcl] a|
|00003480| 6e 64 20 50 4c 70 6c 6f | 74 20 61 72 65 20 65 78 |nd PLplo|t are ex|
|00003490| 61 6d 70 6c 65 73 2e 20 | 20 54 68 65 73 65 20 61 |amples. | These a|
|000034a0| 6c 6f 6e 65 0a 61 72 65 | 20 65 6e 6f 75 67 68 20 |lone.are| enough |
|000034b0| 74 6f 20 61 6c 6c 6f 77 | 20 74 68 65 20 72 61 70 |to allow| the rap|
|000034c0| 69 64 20 70 72 6f 74 6f | 74 79 70 69 6e 67 20 61 |id proto|typing a|
|000034d0| 6e 64 20 64 65 76 65 6c | 6f 70 6d 65 6e 74 20 6f |nd devel|opment o|
|000034e0| 66 20 70 6f 77 65 72 66 | 75 6c 2c 0a 66 6c 65 78 |f powerf|ul,.flex|
|000034f0| 69 62 6c 65 20 67 72 70 | 61 68 69 63 61 6c 20 61 |ible grp|ahical a|
|00003500| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 20 20 4e 6f |pplicati|ons. No|
|00003510| 72 6d 61 6c 6c 79 20 74 | 68 65 20 70 72 6f 67 72 |rmally t|he progr|
|00003520| 61 6d 6d 65 72 20 73 69 | 6d 70 6c 79 0a 77 72 69 |ammer si|mply.wri|
|00003530| 74 65 73 20 61 20 73 68 | 65 6c 6c 20 73 63 72 69 |tes a sh|ell scri|
|00003540| 70 74 20 74 6f 20 62 65 | 20 65 78 65 63 75 74 65 |pt to be| execute|
|00003550| 64 20 62 79 20 74 68 65 | 20 54 6b 20 77 69 6e 64 |d by the| Tk wind|
|00003560| 6f 77 69 6e 67 20 73 68 | 65 6c 6c 2c 0a 5c 63 6f |owing sh|ell,.\co|
|00003570| 64 65 7b 77 69 73 68 7d | 2e 20 20 49 74 20 69 73 |de{wish}|. It is|
|00003580| 20 69 6e 20 76 6f 67 75 | 65 20 66 6f 72 20 65 61 | in vogu|e for ea|
|00003590| 63 68 20 54 63 6c 2f 54 | 6b 20 65 78 74 65 6e 73 |ch Tcl/T|k extens|
|000035a0| 69 6f 6e 20 70 61 63 6b | 61 67 65 20 74 6f 0a 62 |ion pack|age to.b|
|000035b0| 75 69 6c 64 20 69 74 27 | 73 20 6f 77 6e 20 60 60 |uild it'|s own ``|
|000035c0| 65 78 74 65 6e 64 65 64 | 20 57 49 53 48 27 27 2e |extended| WISH''.|
|000035d0| 20 20 54 63 6c 2d 44 50 | 2c 20 66 6f 72 20 65 78 | Tcl-DP|, for ex|
|000035e0| 61 6d 70 6c 65 20 62 75 | 69 6c 64 73 0a 5c 63 6f |ample bu|ilds.\co|
|000035f0| 64 65 7b 64 70 77 69 73 | 68 7d 20 77 68 69 63 68 |de{dpwis|h} which|
|00003600| 20 75 73 65 72 73 20 63 | 61 6e 20 75 73 65 20 74 | users c|an use t|
|00003610| 6f 20 65 76 61 6c 75 61 | 74 65 20 73 63 72 69 70 |o evalua|te scrip|
|00003620| 74 73 20 63 6f 6d 62 69 | 6e 69 6e 67 20 54 63 6c |ts combi|ning Tcl|
|00003630| 2d 44 50 0a 63 6f 6d 6d | 61 6e 64 73 20 77 69 74 |-DP.comm|ands wit|
|00003640| 68 20 73 74 61 6e 64 61 | 72 64 20 54 63 6c 2f 54 |h standa|rd Tcl/T|
|00003650| 6b 2e 20 20 54 68 65 72 | 65 20 61 72 65 20 6d 61 |k. Ther|e are ma|
|00003660| 6e 79 20 65 78 61 6d 70 | 6c 65 73 20 6f 66 20 74 |ny examp|les of t|
|00003670| 68 69 73 2c 20 61 6e 64 | 0a 69 6e 64 65 65 64 20 |his, and|.indeed |
|00003680| 65 76 65 6e 20 50 4c 70 | 6c 6f 74 27 73 20 5c 63 |even PLp|lot's \c|
|00003690| 6f 64 65 7b 70 6c 73 65 | 72 76 65 72 7d 20 70 72 |ode{plse|rver} pr|
|000036a0| 6f 67 72 61 6d 2c 20 64 | 65 73 63 72 69 62 65 64 |ogram, d|escribed|
|000036b0| 20 69 6e 20 61 6e 20 65 | 61 72 6c 69 65 72 0a 63 | in an e|arlier.c|
|000036c0| 68 61 70 74 65 72 2c 20 | 63 6f 75 6c 64 20 6a 75 |hapter, |could ju|
|000036d0| 73 74 20 61 73 20 65 61 | 73 69 6c 79 20 68 61 76 |st as ea|sily hav|
|000036e0| 65 20 62 65 65 6e 20 63 | 61 6c 6c 65 64 20 5c 63 |e been c|alled \c|
|000036f0| 6f 64 65 7b 70 6c 77 69 | 73 68 7d 2e 0a 0a 49 6e |ode{plwi|sh}...In|
|00003700| 20 61 6e 79 20 65 76 65 | 6e 74 2c 20 61 73 20 65 | any eve|nt, as e|
|00003710| 78 63 69 74 69 6e 67 20 | 61 6e 64 20 75 73 65 66 |xciting |and usef|
|00003720| 75 6c 20 61 73 20 74 68 | 65 73 65 20 73 74 61 6e |ul as th|ese stan|
|00003730| 64 61 6c 6f 6e 65 2c 20 | 65 78 74 65 6e 64 65 64 |dalone, |extended|
|00003740| 0a 77 69 6e 64 6f 77 69 | 6e 67 20 73 68 65 6c 6c |.windowi|ng shell|
|00003750| 73 20 6d 61 79 20 62 65 | 2c 20 74 68 65 79 20 61 |s may be|, they a|
|00003760| 72 65 20 75 6c 74 69 6d | 61 74 65 6c 79 20 6f 6e |re ultim|ately on|
|00003770| 6c 79 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |ly the b|eginning|
|00003780| 20 6f 66 0a 77 68 61 74 | 20 79 6f 75 20 63 61 6e | of.what| you can|
|00003790| 20 64 6f 2e 20 20 54 68 | 65 20 72 65 61 6c 20 62 | do. Th|e real b|
|000037a0| 65 6e 65 66 69 74 20 6f | 66 20 74 68 69 73 20 61 |enefit o|f this a|
|000037b0| 70 70 72 6f 61 63 68 20 | 69 73 20 72 65 61 6c 69 |pproach |is reali|
|000037c0| 7a 65 64 20 77 68 65 6e | 0a 79 6f 75 20 6d 61 6b |zed when|.you mak|
|000037d0| 65 20 79 6f 75 72 20 6f | 77 6e 20 60 60 65 78 74 |e your o|wn ``ext|
|000037e0| 65 6e 64 65 64 20 57 49 | 53 48 27 27 2c 20 63 6f |ended WI|SH'', co|
|000037f0| 6d 70 72 69 73 65 64 20 | 6f 66 20 54 63 6c 2c 20 |mprised |of Tcl, |
|00003800| 54 6b 2c 20 61 6e 79 20 | 6f 66 20 74 68 65 0a 73 |Tk, any |of the.s|
|00003810| 74 61 6e 64 61 72 64 20 | 65 78 74 65 6e 73 69 6f |tandard |extensio|
|00003820| 6e 73 20 79 6f 75 20 6c | 69 6b 65 2c 20 61 6e 64 |ns you l|ike, and|
|00003830| 20 66 69 6e 61 6c 6c 79 | 20 65 6d 62 65 6c 6c 69 | finally| embelli|
|00003840| 73 68 65 64 20 77 69 74 | 68 20 61 0a 73 6d 61 74 |shed wit|h a.smat|
|00003850| 74 65 72 69 6e 67 20 6f | 66 20 61 70 70 6c 69 63 |tering o|f applic|
|00003860| 61 74 69 6f 6e 20 73 70 | 65 63 69 66 69 63 20 65 |ation sp|ecific e|
|00003870| 78 74 65 6e 73 69 6f 6e | 73 20 64 65 73 69 67 6e |xtension|s design|
|00003880| 65 64 20 74 6f 20 73 75 | 70 70 6f 72 74 20 79 6f |ed to su|pport yo|
|00003890| 75 72 0a 6f 77 6e 20 61 | 70 70 6c 69 63 61 74 69 |ur.own a|pplicati|
|000038a0| 6f 6e 20 64 6f 6d 61 69 | 6e 2e 20 20 49 6e 20 74 |on domai|n. In t|
|000038b0| 68 69 73 20 73 65 63 74 | 69 6f 6e 20 77 65 20 67 |his sect|ion we g|
|000038c0| 69 76 65 20 61 20 64 65 | 74 61 69 6c 65 64 0a 69 |ive a de|tailed.i|
|000038d0| 6e 74 72 6f 64 75 63 74 | 69 6f 6e 20 74 6f 20 74 |ntroduct|ion to t|
|000038e0| 68 65 20 70 72 6f 63 65 | 73 73 20 6f 66 20 63 6f |he proce|ss of co|
|000038f0| 6e 73 74 72 75 63 74 69 | 6e 67 20 79 6f 75 72 20 |nstructi|ng your |
|00003900| 6f 77 6e 20 57 49 53 48 | 2e 20 20 41 66 74 65 72 |own WISH|. After|
|00003910| 0a 74 68 61 74 2c 20 79 | 6f 75 27 72 65 20 6f 6e |.that, y|ou're on|
|00003920| 20 79 6f 75 72 20 6f 77 | 6e 2e 2e 2e 0a 0a 5c 62 | your ow|n.....\b|
|00003930| 65 67 69 6e 7b 6d 65 6e | 75 7d 0a 2a 20 57 49 53 |egin{men|u}.* WIS|
|00003940| 48 20 63 6f 6e 73 74 72 | 75 63 74 69 6f 6e 3a 3a |H constr|uction::|
|00003950| 09 09 48 6f 77 20 74 6f | 20 77 72 69 74 65 20 63 |..How to| write c|
|00003960| 6f 64 65 20 66 6f 72 20 | 61 20 70 72 69 76 61 74 |ode for |a privat|
|00003970| 65 20 57 49 53 48 0a 2a | 20 57 49 53 48 20 6c 69 |e WISH.*| WISH li|
|00003980| 6e 6b 69 6e 67 3a 3a 09 | 09 54 75 72 6e 69 6e 67 |nking::.|.Turning|
|00003990| 20 79 6f 75 72 20 63 6f | 64 65 20 69 6e 74 6f 20 | your co|de into |
|000039a0| 61 6e 20 65 78 65 63 75 | 74 61 62 6c 65 0a 2a 20 |an execu|table.* |
|000039b0| 57 49 53 48 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |WISH pro|gramming|
|000039c0| 3a 3a 09 09 55 73 69 6e | 67 20 79 6f 75 72 20 6e |::..Usin|g your n|
|000039d0| 65 77 20 57 49 53 48 0a | 5c 65 6e 64 7b 6d 65 6e |ew WISH.|\end{men|
|000039e0| 75 7d 0a 0a 5c 6e 6f 64 | 65 20 57 49 53 48 20 63 |u}..\nod|e WISH c|
|000039f0| 6f 6e 73 74 72 75 63 74 | 69 6f 6e 2c 20 57 49 53 |onstruct|ion, WIS|
|00003a00| 48 20 6c 69 6e 6b 69 6e | 67 2c 20 43 75 73 74 6f |H linkin|g, Custo|
|00003a10| 6d 20 45 78 74 65 6e 73 | 69 6f 6e 73 2c 20 43 75 |m Extens|ions, Cu|
|00003a20| 73 74 6f 6d 20 45 78 74 | 65 6e 73 69 6f 6e 73 0a |stom Ext|ensions.|
|00003a30| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 57 49 53 48 |\subsect|ion{WISH|
|00003a40| 20 43 6f 6e 73 74 72 75 | 63 74 69 6f 6e 7d 0a 5c | Constru|ction}.\|
|00003a50| 63 69 6e 64 65 78 7b 6d | 61 6b 69 6e 67 20 61 20 |cindex{m|aking a |
|00003a60| 77 69 73 68 7d 0a 0a 54 | 68 65 20 73 74 61 6e 64 |wish}..T|he stand|
|00003a70| 61 72 64 20 77 61 79 20 | 74 6f 20 6d 61 6b 65 20 |ard way |to make |
|00003a80| 79 6f 75 72 20 6f 77 6e | 20 57 49 53 48 2c 20 61 |your own| WISH, a|
|00003a90| 73 20 73 75 70 70 6f 72 | 74 65 64 20 62 79 20 74 |s suppor|ted by t|
|00003aa0| 68 65 20 54 63 6c 2f 54 | 6b 0a 73 79 73 74 65 6d |he Tcl/T|k.system|
|00003ab0| 2c 20 69 73 20 74 6f 20 | 74 61 6b 65 20 61 20 62 |, is to |take a b|
|00003ac0| 6f 69 6c 65 72 70 6c 61 | 74 65 20 66 69 6c 65 2c |oilerpla|te file,|
|00003ad0| 20 5c 66 69 6c 65 7b 74 | 6b 41 70 70 49 6e 69 74 | \file{t|kAppInit|
|00003ae0| 2e 63 7d 2c 20 65 64 69 | 74 20 74 6f 0a 72 65 66 |.c}, edi|t to.ref|
|00003af0| 6c 65 63 74 20 74 68 65 | 20 54 63 6c 2f 54 6b 20 |lect the| Tcl/Tk |
|00003b00| 65 78 74 65 6e 73 69 6f | 6e 73 20 79 6f 75 20 77 |extensio|ns you w|
|00003b10| 69 6c 6c 20 62 65 20 72 | 65 71 75 69 72 69 6e 67 |ill be r|equiring|
|00003b20| 2c 20 61 64 64 20 73 6f | 6d 65 20 63 6f 6d 6d 61 |, add so|me comma|
|00003b30| 6e 64 73 0a 74 6f 20 74 | 68 65 20 69 6e 74 65 72 |nds.to t|he inter|
|00003b40| 70 72 65 74 74 65 72 2c | 20 61 6e 64 20 6c 69 6e |pretter,| and lin|
|00003b50| 6b 20 69 74 20 61 6c 6c | 20 74 6f 67 65 74 68 65 |k it all| togethe|
|00003b60| 72 2e 0a 0a 48 65 72 65 | 20 66 6f 72 20 65 78 61 |r...Here| for exa|
|00003b70| 6d 70 6c 65 20 69 73 20 | 74 68 65 20 69 6d 70 6f |mple is |the impo|
|00003b80| 72 74 61 6e 74 20 70 61 | 72 74 20 6f 66 20 74 68 |rtant pa|rt of th|
|00003b90| 65 20 5c 66 69 6c 65 7b | 74 6b 30 32 7d 20 64 65 |e \file{|tk02} de|
|00003ba0| 6d 6f 2c 0a 65 78 74 72 | 61 63 74 65 64 20 66 72 |mo,.extr|acted fr|
|00003bb0| 6f 6d 20 74 68 65 20 66 | 69 6c 65 20 5c 66 69 6c |om the f|ile \fil|
|00003bc0| 65 7b 78 74 6b 30 32 2e | 63 7d 2c 20 77 68 69 63 |e{xtk02.|c}, whic|
|00003bd0| 68 20 69 73 20 65 66 66 | 65 63 74 69 76 65 6c 79 |h is eff|ectively|
|00003be0| 20 74 68 65 0a 65 78 74 | 65 6e 64 65 64 20 57 49 | the.ext|ended WI|
|00003bf0| 53 48 20 64 65 66 69 6e | 69 74 69 6f 6e 20 66 69 |SH defin|ition fi|
|00003c00| 6c 65 20 66 6f 72 20 74 | 68 65 20 5c 66 69 6c 65 |le for t|he \file|
|00003c10| 7b 74 6b 30 32 7d 20 64 | 65 6d 6f 2e 20 20 43 6f |{tk02} d|emo. Co|
|00003c20| 6d 6d 65 6e 74 73 20 61 | 6e 64 0a 6f 74 68 65 72 |mments a|nd.other|
|00003c30| 20 6d 69 73 63 65 6c 61 | 6e 79 20 61 72 65 20 6f | miscela|ny are o|
|00003c40| 6d 69 74 74 65 64 2e 0a | 5c 62 65 67 69 6e 7b 65 |mitted..|\begin{e|
|00003c50| 78 61 6d 70 6c 65 7d 0a | 23 69 6e 63 6c 75 64 65 |xample}.|#include|
|00003c60| 20 22 74 6b 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 | "tk.h".|#include|
|00003c70| 20 22 69 74 63 6c 2e 68 | 22 0a 0a 2f 2a 20 2e 2e | "itcl.h|"../* ..|
|00003c80| 2e 20 2a 2f 0a 0a 69 6e | 74 20 20 20 6d 79 70 6c |. */..in|t mypl|
|00003c90| 6f 74 43 6d 64 20 20 20 | 20 20 20 20 20 28 43 6c |otCmd | (Cl|
|00003ca0| 69 65 6e 74 44 61 74 61 | 2c 20 54 63 6c 5f 49 6e |ientData|, Tcl_In|
|00003cb0| 74 65 72 70 20 2a 2c 20 | 69 6e 74 2c 20 63 68 61 |terp *, |int, cha|
|00003cc0| 72 20 2a 2a 29 3b 0a 0a | 69 6e 74 0a 54 63 6c 5f |r **);..|int.Tcl_|
|00003cd0| 41 70 70 49 6e 69 74 28 | 69 6e 74 65 72 70 29 0a |AppInit(|interp).|
|00003ce0| 20 20 20 20 54 63 6c 5f | 49 6e 74 65 72 70 20 2a | Tcl_|Interp *|
|00003cf0| 69 6e 74 65 72 70 3b 09 | 09 2f 2a 20 49 6e 74 65 |interp;.|./* Inte|
|00003d00| 72 70 72 65 74 65 72 20 | 66 6f 72 20 61 70 70 6c |rpreter |for appl|
|00003d10| 69 63 61 74 69 6f 6e 2e | 20 2a 2f 0a 5c 7b 0a 69 |ication.| */.\{.i|
|00003d20| 6e 74 20 20 20 70 6c 46 | 72 61 6d 65 43 6d 64 20 |nt plF|rameCmd |
|00003d30| 20 20 20 20 20 20 20 28 | 43 6c 69 65 6e 74 44 61 | (|ClientDa|
|00003d40| 74 61 2c 20 54 63 6c 5f | 49 6e 74 65 72 70 20 2a |ta, Tcl_|Interp *|
|00003d50| 2c 20 69 6e 74 2c 20 63 | 68 61 72 20 2a 2a 29 3b |, int, c|har **);|
|00003d60| 0a 0a 20 20 20 20 54 6b | 5f 57 69 6e 64 6f 77 20 |.. Tk|_Window |
|00003d70| 6d 61 69 6e 3b 0a 0a 20 | 20 20 20 6d 61 69 6e 20 |main;.. | main |
|00003d80| 3d 20 54 6b 5f 4d 61 69 | 6e 57 69 6e 64 6f 77 28 |= Tk_Mai|nWindow(|
|00003d90| 69 6e 74 65 72 70 29 3b | 0a 0a 20 20 20 20 2f 2a |interp);|.. /*|
|00003da0| 0a 20 20 20 20 20 2a 20 | 43 61 6c 6c 20 74 68 65 |. * |Call the|
|00003db0| 20 69 6e 69 74 20 70 72 | 6f 63 65 64 75 72 65 73 | init pr|ocedures|
|00003dc0| 20 66 6f 72 20 69 6e 63 | 6c 75 64 65 64 20 70 61 | for inc|luded pa|
|00003dd0| 63 6b 61 67 65 73 2e 20 | 20 45 61 63 68 20 63 61 |ckages. | Each ca|
|00003de0| 6c 6c 20 73 68 6f 75 6c | 64 0a 20 20 20 20 20 2a |ll shoul|d. *|
|00003df0| 20 6c 6f 6f 6b 20 6c 69 | 6b 65 20 74 68 69 73 3a | look li|ke this:|
|00003e00| 0a 20 20 20 20 20 2a 0a | 20 20 20 20 20 2a 20 69 |. *.| * i|
|00003e10| 66 20 28 4d 6f 64 5f 49 | 6e 69 74 28 69 6e 74 65 |f (Mod_I|nit(inte|
|00003e20| 72 70 29 20 3d 3d 20 54 | 43 4c 5f 45 52 52 4f 52 |rp) == T|CL_ERROR|
|00003e30| 29 20 5c 7b 0a 20 20 20 | 20 20 2a 20 20 20 20 20 |) \{. | * |
|00003e40| 72 65 74 75 72 6e 20 54 | 43 4c 5f 45 52 52 4f 52 |return T|CL_ERROR|
|00003e50| 3b 0a 20 20 20 20 20 2a | 20 5c 7d 0a 20 20 20 20 |;. *| \}. |
|00003e60| 20 2a 0a 20 20 20 20 20 | 2a 20 77 68 65 72 65 20 | *. |* where |
|00003e70| 22 4d 6f 64 22 20 69 73 | 20 74 68 65 20 6e 61 6d |"Mod" is| the nam|
|00003e80| 65 20 6f 66 20 74 68 65 | 20 6d 6f 64 75 6c 65 2e |e of the| module.|
|00003e90| 0a 20 20 20 20 20 2a 2f | 0a 0a 20 20 20 20 69 66 |. */|.. if|
|00003ea0| 20 28 54 63 6c 5f 49 6e | 69 74 28 69 6e 74 65 72 | (Tcl_In|it(inter|
|00003eb0| 70 29 20 3d 3d 20 54 43 | 4c 5f 45 52 52 4f 52 29 |p) == TC|L_ERROR)|
|00003ec0| 20 5c 7b 0a 20 20 20 20 | 20 20 20 20 72 65 74 75 | \{. | retu|
|00003ed0| 72 6e 20 54 43 4c 5f 45 | 52 52 4f 52 3b 0a 20 20 |rn TCL_E|RROR;. |
|00003ee0| 20 20 5c 7d 0a 20 20 20 | 20 69 66 20 28 54 6b 5f | \}. | if (Tk_|
|00003ef0| 49 6e 69 74 28 69 6e 74 | 65 72 70 29 20 3d 3d 20 |Init(int|erp) == |
|00003f00| 54 43 4c 5f 45 52 52 4f | 52 29 20 5c 7b 0a 20 20 |TCL_ERRO|R) \{. |
|00003f10| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 54 43 4c | re|turn TCL|
|00003f20| 5f 45 52 52 4f 52 3b 0a | 20 20 20 20 5c 7d 0a 20 |_ERROR;.| \}. |
|00003f30| 20 20 20 69 66 20 28 49 | 74 63 6c 5f 49 6e 69 74 | if (I|tcl_Init|
|00003f40| 28 69 6e 74 65 72 70 29 | 20 3d 3d 20 54 43 4c 5f |(interp)| == TCL_|
|00003f50| 45 52 52 4f 52 29 20 5c | 7b 0a 20 20 20 20 20 20 |ERROR) \|{. |
|00003f60| 20 20 72 65 74 75 72 6e | 20 54 43 4c 5f 45 52 52 | return| TCL_ERR|
|00003f70| 4f 52 3b 0a 20 20 20 20 | 5c 7d 0a 20 20 20 20 69 |OR;. |\}. i|
|00003f80| 66 20 28 50 6c 74 6b 5f | 49 6e 69 74 28 69 6e 74 |f (Pltk_|Init(int|
|00003f90| 65 72 70 29 20 3d 3d 20 | 54 43 4c 5f 45 52 52 4f |erp) == |TCL_ERRO|
|00003fa0| 52 29 20 5c 7b 0a 20 20 | 20 20 20 20 20 20 72 65 |R) \{. | re|
|00003fb0| 74 75 72 6e 20 54 43 4c | 5f 45 52 52 4f 52 3b 0a |turn TCL|_ERROR;.|
|00003fc0| 20 20 20 20 5c 7d 0a 0a | 20 20 20 20 2f 2a 0a 20 | \}..| /*. |
|00003fd0| 20 20 20 20 2a 20 43 61 | 6c 6c 20 54 63 6c 5f 43 | * Ca|ll Tcl_C|
|00003fe0| 72 65 61 74 65 43 6f 6d | 6d 61 6e 64 20 66 6f 72 |reateCom|mand for|
|00003ff0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2d 73 70 65 | applica|tion-spe|
|00004000| 63 69 66 69 63 20 63 6f | 6d 6d 61 6e 64 73 2c 20 |cific co|mmands, |
|00004010| 69 66 0a 20 20 20 20 20 | 2a 20 74 68 65 79 20 77 |if. |* they w|
|00004020| 65 72 65 6e 27 74 20 61 | 6c 72 65 61 64 79 20 63 |eren't a|lready c|
|00004030| 72 65 61 74 65 64 20 62 | 79 20 74 68 65 20 69 6e |reated b|y the in|
|00004040| 69 74 20 70 72 6f 63 65 | 64 75 72 65 73 20 63 61 |it proce|dures ca|
|00004050| 6c 6c 65 64 20 61 62 6f | 76 65 2e 0a 20 20 20 20 |lled abo|ve.. |
|00004060| 20 2a 2f 0a 0a 20 20 20 | 20 54 63 6c 5f 43 72 65 | */.. | Tcl_Cre|
|00004070| 61 74 65 43 6f 6d 6d 61 | 6e 64 28 69 6e 74 65 72 |ateComma|nd(inter|
|00004080| 70 2c 20 22 6d 79 70 6c | 6f 74 22 2c 20 6d 79 70 |p, "mypl|ot", myp|
|00004090| 6c 6f 74 43 6d 64 2c 0a | 20 20 20 20 20 20 20 20 |lotCmd,.| |
|000040a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 28 43 | | (C|
|000040b0| 6c 69 65 6e 74 44 61 74 | 61 29 20 6d 61 69 6e 2c |lientDat|a) main,|
|000040c0| 20 28 76 6f 69 64 20 28 | 2a 29 28 43 6c 69 65 6e | (void (|*)(Clien|
|000040d0| 74 44 61 74 61 29 29 20 | 4e 55 4c 4c 29 3b 0a 0a |tData)) |NULL);..|
|000040e0| 0a 20 20 20 20 2f 2a 0a | 20 20 20 20 20 2a 20 53 |. /*.| * S|
|000040f0| 70 65 63 69 66 79 20 61 | 20 75 73 65 72 2d 73 70 |pecify a| user-sp|
|00004100| 65 63 69 66 69 63 20 73 | 74 61 72 74 75 70 20 66 |ecific s|tartup f|
|00004110| 69 6c 65 20 74 6f 20 69 | 6e 76 6f 6b 65 20 69 66 |ile to i|nvoke if|
|00004120| 20 74 68 65 0a 20 20 20 | 20 20 2a 20 61 70 70 6c | the. | * appl|
|00004130| 69 63 61 74 69 6f 6e 20 | 69 73 20 72 75 6e 20 69 |ication |is run i|
|00004140| 6e 74 65 72 61 63 74 69 | 76 65 6c 79 2e 20 20 54 |nteracti|vely. T|
|00004150| 79 70 69 63 61 6c 6c 79 | 20 74 68 65 20 73 74 61 |ypically| the sta|
|00004160| 72 74 75 70 0a 20 20 20 | 20 20 2a 20 66 69 6c 65 |rtup. | * file|
|00004170| 20 69 73 20 22 7e 2f 2e | 61 70 70 72 63 22 20 77 | is "~/.|apprc" w|
|00004180| 68 65 72 65 20 22 61 70 | 70 22 20 69 73 20 74 68 |here "ap|p" is th|
|00004190| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 20 61 70 |e name o|f the ap|
|000041a0| 70 6c 69 63 61 74 69 6f | 6e 2e 0a 20 20 20 20 20 |plicatio|n.. |
|000041b0| 2a 20 49 66 20 74 68 69 | 73 20 6c 69 6e 65 20 69 |* If thi|s line i|
|000041c0| 73 20 64 65 6c 65 74 65 | 64 74 68 65 6e 20 6e 6f |s delete|dthen no|
|000041d0| 20 75 73 65 72 2d 73 70 | 65 63 69 66 69 63 20 73 | user-sp|ecific s|
|000041e0| 74 61 72 74 75 70 20 66 | 69 6c 65 0a 20 20 20 20 |tartup f|ile. |
|000041f0| 20 2a 20 77 69 6c 6c 20 | 62 65 20 72 75 6e 20 75 | * will |be run u|
|00004200| 6e 64 65 72 20 61 6e 79 | 20 63 6f 6e 64 69 74 69 |nder any| conditi|
|00004210| 6f 6e 73 2e 0a 20 20 20 | 20 20 2a 2f 0a 0a 20 20 |ons.. | */.. |
|00004220| 20 20 74 63 6c 5f 52 63 | 46 69 6c 65 4e 61 6d 65 | tcl_Rc|FileName|
|00004230| 20 3d 20 22 7e 2f 2e 77 | 69 73 68 72 63 22 3b 0a | = "~/.w|ishrc";.|
|00004240| 20 20 20 20 72 65 74 75 | 72 6e 20 54 43 4c 5f 4f | retu|rn TCL_O|
|00004250| 4b 3b 0a 5c 7d 0a 0a 2f | 2a 20 2e 2e 2e 20 6d 79 |K;.\}../|* ... my|
|00004260| 50 6c 6f 74 43 6d 64 2c | 20 65 74 63 20 2e 2e 2e |PlotCmd,| etc ...|
|00004270| 20 2a 2f 0a 5c 65 6e 64 | 7b 65 78 61 6d 70 6c 65 | */.\end|{example|
|00004280| 7d 0a 0a 54 68 65 20 63 | 61 6c 6c 73 20 74 6f 20 |}..The c|alls to |
|00004290| 5c 63 6f 64 65 7b 54 63 | 6c 5f 49 6e 69 74 28 29 |\code{Tc|l_Init()|
|000042a0| 7d 20 61 6e 64 20 5c 63 | 6f 64 65 7b 54 6b 5f 49 |} and \c|ode{Tk_I|
|000042b0| 6e 69 74 28 29 7d 20 61 | 72 65 20 69 6e 20 65 76 |nit()} a|re in ev|
|000042c0| 65 72 79 20 57 49 53 48 | 2e 0a 54 6f 20 6d 61 6b |ery WISH|..To mak|
|000042d0| 65 20 61 6e 20 65 78 74 | 65 6e 64 65 64 20 57 49 |e an ext|ended WI|
|000042e0| 53 48 2c 20 79 6f 75 20 | 61 64 64 20 63 61 6c 6c |SH, you |add call|
|000042f0| 73 20 74 6f 20 74 68 65 | 20 69 6e 69 74 69 61 6c |s to the| initial|
|00004300| 69 7a 61 74 69 6f 6e 20 | 72 6f 75 74 69 6e 65 73 |ization |routines|
|00004310| 0a 66 6f 72 20 61 6e 79 | 20 65 78 74 65 6e 73 69 |.for any| extensi|
|00004320| 6f 6e 20 70 61 63 6b 61 | 67 65 73 20 79 6f 75 20 |on packa|ges you |
|00004330| 77 61 6e 74 20 74 6f 20 | 75 73 65 2c 20 69 6e 20 |want to |use, in |
|00004340| 74 68 69 73 20 5b 69 6e | 63 72 20 54 63 6c 5d 0a |this [in|cr Tcl].|
|00004350| 28 5c 63 6f 64 65 7b 49 | 74 63 6c 5f 49 6e 69 74 |(\code{I|tcl_Init|
|00004360| 28 29 7d 29 20 61 6e 64 | 20 50 4c 70 6c 6f 74 20 |()}) and| PLplot |
|00004370| 28 5c 63 6f 64 65 7b 50 | 6c 74 6b 5f 49 6e 69 74 |(\code{P|ltk_Init|
|00004380| 28 29 7d 29 2e 20 20 46 | 69 6e 61 6c 6c 79 20 79 |()}). F|inally y|
|00004390| 6f 75 20 61 64 64 0a 6b | 65 79 77 6f 72 64 73 20 |ou add.k|eywords |
|000043a0| 74 6f 20 74 68 65 20 69 | 6e 74 65 72 70 72 65 74 |to the i|nterpret|
|000043b0| 74 65 72 2c 20 61 73 73 | 6f 63 69 61 74 69 6e 67 |ter, ass|ociating|
|000043c0| 20 74 68 65 6d 20 77 69 | 74 68 20 66 75 6e 63 74 | them wi|th funct|
|000043d0| 69 6f 6e 73 20 69 6e 20 | 79 6f 75 72 0a 63 6f 64 |ions in |your.cod|
|000043e0| 65 20 75 73 69 6e 67 20 | 5c 63 6f 64 65 7b 54 63 |e using |\code{Tc|
|000043f0| 6c 5f 43 72 65 61 74 65 | 43 6f 6d 6d 61 6e 64 28 |l_Create|Command(|
|00004400| 29 7d 20 61 73 20 73 68 | 6f 77 6e 2e 0a 0a 49 6e |)} as sh|own...In|
|00004410| 20 70 61 72 74 69 63 75 | 6c 61 72 2c 20 50 4c 70 | particu|lar, PLp|
|00004420| 6c 6f 74 20 68 61 73 20 | 61 20 6e 75 6d 62 65 72 |lot has |a number|
|00004430| 20 6f 66 20 5b 69 6e 63 | 72 20 54 63 6c 5d 20 63 | of [inc|r Tcl] c|
|00004440| 6c 61 73 73 65 73 20 69 | 6e 20 69 74 73 20 54 63 |lasses i|n its Tc|
|00004450| 6c 0a 6c 69 62 72 61 72 | 79 2e 20 20 49 66 20 79 |l.librar|y. If y|
|00004460| 6f 75 20 77 61 6e 74 20 | 74 6f 20 62 65 20 61 62 |ou want |to be ab|
|00004470| 6c 65 20 74 6f 20 75 73 | 65 20 74 68 6f 73 65 20 |le to us|e those |
|00004480| 69 6e 20 79 6f 75 72 20 | 57 49 53 48 2c 20 79 6f |in your |WISH, yo|
|00004490| 75 20 6e 65 65 64 0a 74 | 6f 20 69 6e 63 6c 75 64 |u need.t|o includ|
|000044a0| 65 20 74 68 65 20 69 6e | 69 74 69 61 6c 69 7a 61 |e the in|itializa|
|000044b0| 74 69 6f 6e 20 6f 66 20 | 5b 69 6e 63 72 20 54 63 |tion of |[incr Tc|
|000044c0| 6c 5d 2e 0a 0a 5c 6e 6f | 64 65 20 57 49 53 48 20 |l]...\no|de WISH |
|000044d0| 6c 69 6e 6b 69 6e 67 2c | 20 57 49 53 48 20 70 72 |linking,| WISH pr|
|000044e0| 6f 67 72 61 6d 6d 69 6e | 67 2c 20 57 49 53 48 20 |ogrammin|g, WISH |
|000044f0| 63 6f 6e 73 74 72 75 63 | 74 69 6f 6e 2c 20 43 75 |construc|tion, Cu|
|00004500| 73 74 6f 6d 20 45 78 74 | 65 6e 73 69 6f 6e 73 0a |stom Ext|ensions.|
|00004510| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 57 49 53 48 |\subsect|ion{WISH|
|00004520| 20 4c 69 6e 6b 69 6e 67 | 7d 0a 0a 48 61 76 69 6e | Linking|}..Havin|
|00004530| 67 20 63 6f 6e 73 74 72 | 75 63 74 65 64 20 79 6f |g constr|ucted yo|
|00004540| 75 72 20 5c 63 6f 64 65 | 7b 54 63 6c 5f 41 70 70 |ur \code|{Tcl_App|
|00004550| 49 6e 69 74 28 29 7d 20 | 66 75 6e 63 74 69 6f 6e |Init()} |function|
|00004560| 2c 20 79 6f 75 20 6e 6f | 77 20 6d 65 72 65 6c 79 |, you no|w merely|
|00004570| 0a 6e 65 65 64 20 74 6f | 20 6c 69 6e 6b 20 74 68 |.need to| link th|
|00004580| 69 73 20 66 69 6c 65 20 | 77 69 74 68 20 79 6f 75 |is file |with you|
|00004590| 72 20 6f 77 6e 20 70 72 | 69 76 61 74 65 20 66 69 |r own pr|ivate fi|
|000045a0| 6c 65 73 20 74 6f 20 70 | 72 6f 76 69 64 65 20 74 |les to p|rovide t|
|000045b0| 68 65 20 63 6f 64 65 0a | 66 6f 72 20 61 6e 79 20 |he code.|for any |
|000045c0| 66 75 6e 63 74 69 6f 6e | 73 20 79 6f 75 20 72 65 |function|s you re|
|000045d0| 67 69 73 74 65 72 65 64 | 20 76 69 61 20 5c 63 6f |gistered| via \co|
|000045e0| 64 65 7b 54 63 6c 5f 43 | 72 65 61 74 65 43 6f 6d |de{Tcl_C|reateCom|
|000045f0| 6d 61 6e 64 28 29 7d 20 | 28 61 6e 64 0a 61 6e 79 |mand()} |(and.any|
|00004600| 20 74 68 65 79 20 64 65 | 70 65 6e 64 20 6f 6e 29 | they de|pend on)|
|00004610| 2c 20 61 67 61 69 6e 73 | 74 20 74 68 65 20 54 63 |, agains|t the Tc|
|00004620| 6c 2c 20 54 6b 20 61 6e | 64 20 65 78 74 65 6e 73 |l, Tk an|d extens|
|00004630| 69 6f 6e 20 6c 69 62 72 | 61 72 69 65 73 20 79 6f |ion libr|aries yo|
|00004640| 75 0a 61 72 65 20 75 73 | 69 6e 67 2e 0a 5c 62 65 |u.are us|ing..\be|
|00004650| 67 69 6e 7b 65 78 61 6d | 70 6c 65 7d 0a 63 63 20 |gin{exam|ple}.cc |
|00004660| 2d 63 20 74 6b 41 70 70 | 49 6e 69 74 2e 63 0a 63 |-c tkApp|Init.c.c|
|00004670| 63 20 2d 63 20 6d 79 63 | 6f 6d 6d 61 6e 64 73 2e |c -c myc|ommands.|
|00004680| 63 0a 63 63 20 2d 6f 20 | 6d 79 5f 77 69 73 68 20 |c.cc -o |my_wish |
|00004690| 74 6b 41 70 70 49 6e 69 | 74 2e 6f 20 6d 79 63 6f |tkAppIni|t.o myco|
|000046a0| 6d 6d 61 6e 64 73 2e 6f | 20 0a 20 20 20 20 20 20 |mmands.o| . |
|000046b0| 20 20 20 20 20 2d 6c 70 | 6c 70 6c 6f 74 66 74 6b | -lp|lplotftk|
|000046c0| 20 2d 6c 74 63 6c 20 2d | 6c 74 6b 20 2d 6c 69 74 | -ltcl -|ltk -lit|
|000046d0| 63 6c 20 2d 6c 58 31 31 | 20 2d 6c 6d 0a 5c 65 6e |cl -lX11| -lm.\en|
|000046e0| 64 7b 65 78 61 6d 70 6c | 65 7d 0a 41 64 64 20 61 |d{exampl|e}.Add a|
|000046f0| 6e 79 20 6e 65 65 64 65 | 64 20 5c 63 6f 64 65 7b |ny neede|d \code{|
|00004700| 2d 4c 7d 20 6f 70 74 69 | 6f 6e 73 20 61 73 20 6e |-L} opti|ons as n|
|00004710| 65 65 64 65 64 2e 0a 0a | 56 6f 69 6c 61 21 20 20 |eeded...|Voila! |
|00004720| 59 6f 75 20 68 61 76 65 | 20 6d 61 64 65 20 61 20 |You have| made a |
|00004730| 77 69 73 68 2e 0a 0a 5c | 6e 6f 64 65 20 57 49 53 |wish...\|node WIS|
|00004740| 48 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2c 20 2c |H progra|mming, ,|
|00004750| 20 57 49 53 48 20 6c 69 | 6e 6b 69 6e 67 2c 20 43 | WISH li|nking, C|
|00004760| 75 73 74 6f 6d 20 45 78 | 74 65 6e 73 69 6f 6e 73 |ustom Ex|tensions|
|00004770| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 7b 57 49 53 |.\subsec|tion{WIS|
|00004780| 48 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 7d 0a 0a |H Progra|mming}..|
|00004790| 4e 6f 77 20 79 6f 75 20 | 61 72 65 20 72 65 61 64 |Now you |are read|
|000047a0| 79 20 74 6f 20 70 75 74 | 20 74 68 65 20 67 65 6e |y to put| the gen|
|000047b0| 69 65 20 74 6f 20 77 6f | 72 6b 2e 20 20 54 68 65 |ie to wo|rk. The|
|000047c0| 20 62 61 73 69 63 20 70 | 6c 61 6e 20 68 65 72 65 | basic p|lan here|
|000047d0| 20 69 73 20 74 6f 0a 77 | 72 69 74 65 20 73 68 65 | is to.w|rite she|
|000047e0| 6c 6c 20 73 63 72 69 70 | 74 73 20 77 68 69 63 68 |ll scrip|ts which|
|000047f0| 20 75 73 65 20 79 6f 75 | 72 20 6e 65 77 20 61 70 | use you|r new ap|
|00004800| 70 6c 69 63 61 74 69 6f | 6e 20 73 70 65 63 69 66 |plicatio|n specif|
|00004810| 69 63 20 77 69 6e 64 6f | 77 69 6e 67 0a 73 68 65 |ic windo|wing.she|
|00004820| 6c 6c 20 61 73 20 74 68 | 65 69 72 20 69 6e 74 65 |ll as th|eir inte|
|00004830| 72 70 72 65 74 65 72 2c | 20 74 6f 20 69 6d 6c 65 |rpreter,| to imle|
|00004840| 6d 65 6e 74 20 58 20 57 | 69 6e 64 6f 77 73 20 75 |ment X W|indows u|
|00004850| 73 65 72 20 69 6e 74 65 | 72 66 61 63 65 73 20 74 |ser inte|rfaces t|
|00004860| 6f 0a 63 6f 6e 74 72 6f | 6c 20 61 6e 64 20 75 74 |o.contro|l and ut|
|00004870| 69 6c 69 7a 65 20 74 68 | 65 20 66 61 63 69 6c 69 |ilize th|e facili|
|00004880| 74 69 65 73 20 6d 61 64 | 65 20 61 76 61 69 6c 61 |ties mad|e availa|
|00004890| 62 6c 65 20 69 6e 20 79 | 6f 75 72 20 65 78 74 65 |ble in y|our exte|
|000048a0| 6e 73 69 6f 6e 73 2e 0a | 0a 45 66 66 65 63 74 69 |nsions..|.Effecti|
|000048b0| 76 65 6c 79 20 74 68 69 | 73 20 6a 75 73 74 20 63 |vely thi|s just c|
|000048c0| 6f 6d 65 73 20 64 6f 77 | 6e 20 74 6f 20 77 72 74 |omes dow|n to wrt|
|000048d0| 69 6e 67 20 54 63 6c 2f | 54 6b 20 63 6f 64 65 2c |ing Tcl/|Tk code,|
|000048e0| 20 65 6d 62 65 6c 6c 69 | 73 68 65 64 20 61 73 0a | embelli|shed as.|
|000048f0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 77 69 74 68 |appropri|ate with|
|00004900| 20 63 61 6c 6c 73 20 74 | 6f 20 74 68 65 20 65 78 | calls t|o the ex|
|00004910| 74 65 6e 73 69 6f 6e 20 | 63 6f 6d 6d 61 6e 64 73 |tension |commands|
|00004920| 20 79 6f 75 20 72 65 67 | 69 73 74 65 72 65 64 2e | you reg|istered.|
|00004930| 0a 41 64 64 69 74 69 6f | 6e 61 6c 6c 79 2c 20 73 |.Additio|nally, s|
|00004940| 69 6e 63 65 20 74 68 69 | 73 20 77 69 73 68 20 69 |ince thi|s wish i|
|00004950| 6e 63 6c 75 64 65 73 20 | 74 68 65 20 50 4c 70 6c |ncludes |the PLpl|
|00004960| 6f 74 20 65 78 74 65 6e | 73 69 6f 6e 73 2c 20 79 |ot exten|sions, y|
|00004970| 6f 75 20 63 61 6e 0a 69 | 6e 73 74 61 6e 74 69 61 |ou can.i|nstantia|
|00004980| 74 65 20 61 6e 79 20 6f | 66 20 74 68 65 20 50 4c |te any o|f the PL|
|00004990| 70 6c 6f 74 20 66 61 6d | 69 6c 79 20 6f 66 20 5b |plot fam|ily of [|
|000049a0| 69 6e 63 72 20 54 63 6c | 5d 20 63 6c 61 73 73 65 |incr Tcl|] classe|
|000049b0| 73 2c 20 61 6e 64 20 69 | 6e 76 6f 6b 65 0a 6d 65 |s, and i|nvoke.me|
|000049c0| 74 68 6f 64 73 20 6f 6e | 20 74 68 6f 73 65 20 6f |thods on| those o|
|000049d0| 62 6a 65 63 74 73 20 74 | 6f 20 65 66 66 65 63 74 |bjects t|o effect|
|000049e0| 20 74 68 65 20 64 72 61 | 77 69 6e 67 20 6f 66 20 | the dra|wing of |
|000049f0| 67 72 61 70 68 73 2e 20 | 20 53 69 6d 69 6c 61 72 |graphs. | Similar|
|00004a00| 6c 79 2c 0a 79 6f 75 20 | 6d 61 79 20 68 61 76 65 |ly,.you |may have|
|00004a10| 20 79 6f 75 72 20 65 78 | 74 65 6e 73 69 6f 6e 20 | your ex|tension |
|00004a20| 63 6f 6d 6d 61 6e 64 73 | 20 28 77 68 69 63 68 20 |commands| (which |
|00004a30| 61 72 65 20 63 6f 64 65 | 64 20 69 6e 20 43 29 20 |are code|d in C) |
|00004a40| 63 61 6c 6c 20 74 68 65 | 0a 50 4c 70 6c 6f 74 20 |call the|.PLplot |
|00004a50| 43 20 70 72 6f 67 72 61 | 6d 6d 65 72 73 20 41 50 |C progra|mmers AP|
|00004a60| 49 20 74 6f 20 64 72 61 | 77 20 69 6e 74 6f 20 74 |I to dra|w into t|
|00004a70| 68 65 20 77 69 64 67 65 | 74 2e 20 20 49 6e 20 74 |he widge|t. In t|
|00004a80| 68 69 73 20 77 61 79 20 | 79 6f 75 20 63 61 6e 0a |his way |you can.|
|00004a90| 68 61 76 65 20 74 68 65 | 20 62 65 73 74 20 6f 66 |have the| best of|
|00004aa0| 20 62 6f 74 68 20 77 6f | 72 6c 64 73 2e 20 20 55 | both wo|rlds. U|
|00004ab0| 73 65 20 63 6f 6d 70 69 | 6c 65 64 20 43 20 63 6f |se compi|led C co|
|00004ac0| 64 65 20 77 68 65 6e 20 | 74 68 65 0a 63 6f 6d 70 |de when |the.comp|
|00004ad0| 75 74 61 74 69 6f 6e 61 | 6c 20 64 65 6d 61 6e 64 |utationa|l demand|
|00004ae0| 73 20 72 65 71 75 69 72 | 65 20 74 68 65 20 73 70 |s requir|e the sp|
|00004af0| 65 65 64 20 6f 66 20 63 | 6f 6d 70 69 6c 65 64 20 |eed of c|ompiled |
|00004b00| 63 6f 64 65 2c 20 6f 72 | 20 75 73 65 20 54 63 6c |code, or| use Tcl|
|00004b10| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+